Cannot install gulp-sass

I am trying to learn how to use gulp / sass / and all other useful tools using Nodejs, and I had a problem installing gulp-sass. The process that I use to install everything:

1. Start Git Bash in the project folder 2. npm init 3. npm install gulp -g 4. npm install gulp --save-dev 5. npm install gulp-sass <- this is where I get errors 

As soon as I get to step five, I get the following error:

 $ npm install gulp-sass npm WARN package.json project@1.0.0 No repository field. npm WARN package.json project@1.0.0 No README data - > node-sass@3.2.0 install \\primary\home\mendsley\profile\Desktop\project\node_modules\gulp- sass\node_modules\node-sass > node scripts/install.js '\\primary\home\mendsley\profile\Desktop\project\node_modules\gulp- sass\node_modules\node-sass' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. module.js:338 throw err; ^ Error: Cannot find module 'C:\Windows\scripts\install.js' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3 npm ERR! Windows_NT 6.1.7601 npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Users\\mendsley\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-sass" npm ERR! node v0.12.1 npm ERR! npm v2.13.1 npm ERR! code ELIFECYCLE npm ERR! node-sass@3.2.0 install: `node scripts/install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@3.2.0 install script 'node scripts/install.js'. npm ERR! This is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node scripts/install.js npm ERR! You can get their info via: npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! \\primary\home\mendsley\profile\Desktop\project\npm-debug.log 

I am trying to do this on my working computer, so I'm not sure if this is important. The system administrator says that there should be no problems, and other people have no problems with one package ... and talking to them, they do not help. I tried everything on my personal laptop, and gulp-sass installs just fine, so this is something with my working computer.

My initial thought is a path issue, but then why are other packages being installed normally?

I uninstalled / reinstalled Nodejs, but this did not help.

Does anyone have any ideas?

Thanks in advance!

+5
source share
4 answers

Your first guess was good, as it is a path name question. From the error message:

UNC paths are not supported. By default, the Windows directory is used.

Npm is required to access \\primary\home\mendsley\...\node_modules\node-sass in order to install the gulp -sass script. But this path is a UNC loop (Uniform Naming Convention) and therefore not supported.

As a result, the npm command used C: / Windows by default and tries to install the script from gulp -sass (install.js), but this script, as you might have guessed, is not present in this directory.

+2
source

This may be a hell dependency issue with an older version of NodeJS or NPM. gulp-sass depends on node-sass , which in turn depends on other packages, and they also depend on the correct version of NodeJS and NPM. For version 0.7.3 full dependencies look like this:

β”œβ”€β”¬ gulp-sass@0.7.3 β”‚ β”œβ”€β”€ map-stream@0.1.0 β”‚ └─┬ node-sass@0.9.6 β”‚ β”œβ”€β”¬ chalk@0.5.1 β”‚ β”‚ β”œβ”€β”€ ansi-styles@1.1.0 β”‚ β”‚ β”œβ”€β”€ escape-string-regexp@1.0.3 β”‚ β”‚ β”œβ”€β”¬ has-ansi@0.1.0 β”‚ β”‚ β”‚ └── ansi-regex@0.2.1 β”‚ β”‚ β”œβ”€β”¬ strip-ansi@0.3.0 β”‚ β”‚ β”‚ └── ansi-regex@0.2.1 β”‚ β”‚ └── supports-color@0.2.0 β”‚ β”œβ”€β”€ get-stdin@3.0.2 β”‚ β”œβ”€β”¬ mkdirp@0.5.1 β”‚ β”‚ └── minimist@0.0.8 β”‚ β”œβ”€β”¬ mocha@1.21.5 β”‚ β”‚ β”œβ”€β”€ commander@2.3.0 β”‚ β”‚ β”œβ”€β”¬ debug@2.0.0 β”‚ β”‚ β”‚ └── ms@0.6.2 β”‚ β”‚ β”œβ”€β”€ diff@1.0.8 β”‚ β”‚ β”œβ”€β”€ escape-string-regexp@1.0.2 β”‚ β”‚ β”œβ”€β”¬ glob@3.2.3 β”‚ β”‚ β”‚ β”œβ”€β”€ graceful-fs@2.0.3 β”‚ β”‚ β”‚ β”œβ”€β”€ inherits@2.0.1 β”‚ β”‚ β”‚ └─┬ minimatch@0.2.14 β”‚ β”‚ β”‚ β”œβ”€β”€ lru-cache@2.7.3 β”‚ β”‚ β”‚ └── sigmund@1.0.1 β”‚ β”‚ β”œβ”€β”€ growl@1.8.1 β”‚ β”‚ β”œβ”€β”¬ jade@0.26.3 β”‚ β”‚ β”‚ β”œβ”€β”€ commander@0.6.1 β”‚ β”‚ β”‚ └── mkdirp@0.3.0 β”‚ β”‚ └─┬ mkdirp@0.5.0 β”‚ β”‚ └── minimist@0.0.8 β”‚ β”œβ”€β”€ nan@1.3.0 β”‚ β”œβ”€β”€ node-sass-middleware@0.3.1 β”‚ β”œβ”€β”€ node-watch@0.3.5 β”‚ β”œβ”€β”€ object-assign@1.0.0 β”‚ β”œβ”€β”¬ sinon@1.10.3 β”‚ β”‚ β”œβ”€β”¬ formatio@1.0.2 β”‚ β”‚ β”‚ └── samsam@1.1.3 β”‚ β”‚ └─┬ util@0.10.3 β”‚ β”‚ └── inherits@2.0.1 β”‚ └── yargs@1.3.3

I had a problem installing version 0.7.3 from gulp-sass with the latest versions of NodeJS 5.2.0 and NPM 3.5.2 . This old version of gulp-sass only worked with the old version of NodeJS 0.12.9 and NPM 2.14.9 , see also https://github.com/sass/node-sass/issues/1166

+2
source

Look at this:

"CMD.EXE was launched with the above path as the current directory. UNC paths are not supported. By default, the Windows directory is used.

You can use the pushd command. As an example for --global Installation for a domain user in a network share:

pushd \\server\yourpath\user\AppData\Roaming\npm

Hint: you can find the right way for global npm installations using %appdata%\npm in your explorer, cmd answers:

Z:\user\AppData\Roaming\npm>

you can now enter "npm install node-sass" (or gulp-sass or something else)

Z:\user\AppData\Roaming\npm>npm install node-sass

without -global or -g, you’re β€œglobal” along the way

if finished, then popd to disable Z:

+1
source

I had the same problem and fixed it with a simple step.

The real problem is that autostart sets the path to the command line. This is related to your registry. I just deleted the autorun file in the registry for the command processor and started working normally.

Go to this link

0
source

All Articles