Cannot Install gulp-sass

Mike picture Mike · Jul 22, 2015 · Viewed 17.6k times · Source

I'm trying to learn how to use gulp / sass / and all the other fun tools with Nodejs and I'm having an issue installing gulp-sass. The process I'm using to install everything is:

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

Once I get to step five, I get the following error:

$ npm install gulp-sass
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
-
> [email protected] 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! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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'm trying this on my work computer, so I'm not sure if that matters. The system admin says there should not be any issue and other people have no issue with same package...and talking to them, they offer no help. I tried everything on my personal laptop and gulp-sass installs just fine, so it is something with my work pc.

My initial thought is it's a path issue, but then why do other packages install okay?

I did uninstall/reinstall Nodejs, but that didn't help.

Does anyone have an idea?

Thanks in advance!

Answer

Michael P. Bazos picture Michael P. Bazos · Jul 22, 2015

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

UNC paths are not supported. Defaulting to Windows directory.

Npm needed to access \\primary\home\mendsley\...\node_modules\node-sass so as to execute the gulp-sass installation script. But this path is a UNC path (Uniform Naming Convention) and therefore is not supported.

As a consequence, the npm command defaulted to C:/Windows instead and tries to execute the installation script of gulp-sass (install.js) but this script is, as you might guess, not present in this directory.