node-sass: Windows 8.1 Pro 64-bit: gulp-sass install failing due to node-sass@2.1.1 install script failure

Basic diagnostic information

OS: Windows 8.1 Pro
Node: Installed from node-v0.12.5-x64.msi into c:\nodejs directory

C:\projects\git\dm-mobile>npm -v
2.11.2
C:\projects\git\dm-mobile>node -v
v0.12.5
C:\projects\git\dm-mobile>node -p process.versions
{ http_parser: '2.3',
  node: '0.12.5',
  v8: '3.28.71.19',
  uv: '1.6.1',
  zlib: '1.2.8',
  modules: '14',
  openssl: '1.0.1o' }
C:\projects\git\dm-mobile>node -p process.platform
win32
C:\projects\git\dm-mobile>node -p process.arch
x64

Attempting to install gulp-sass using this command:

npm install gulp-sass -save-dev

The output from the command above indicates that node-sass@2.1.1 install failed.

npm WARN package.json dm-mobile@1.0.0 No repository field.
npm WARN package.json dm-mobile@1.0.0 No README data
npm WARN package.json dm-mobile@1.0.0 No license field.
\
> node-sass@2.1.1 install C:\projects\git\dm-mobile\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js

module.js:338
    throw err;
          ^
Error: Cannot find module 'c:\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.3.9600
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp-sass" "-save-dev"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! node-sass@2.1.1 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@2.1.1 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!     C:\projects\git\dm-mobile\npm-debug.log

Attempting to install node-sass directly via npm install node-sass -g also fails. The output is below:

C:\Users\Keith Wedinger\AppData\Roaming\npm\node-sass -> C:\Users\Keith Wedinger\AppData\Roaming\npm\node_modules\node-sass\bin\node-sass

> node-sass@3.2.0 install C:\Users\Keith Wedinger\AppData\Roaming\npm\node_modules\node-sass
> node scripts/install.js

module.js:338
    throw err;
          ^
Error: Cannot find module 'c:\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.3.9600
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass" "-g"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
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!     C:\test\npm-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 33 (18 by maintainers)

Commits related to this issue

Most upvoted comments

I added some additional logging to my local install of node to see what is actually going on and discovered the following:

  • nodejs\node_modules\npm\lib\utils\spawn.js is used to start scripts\install.js
  • By adding some additional logging, I discovered that spawn.js is using the following command line to start install.js: C:\WINDOWS\system32\cmd.exe /c node scripts/install.js
  • In a separate command prompt window, I changed to my c:\test directory and I ran C:\WINDOWS\system32\cmd.exe /c node
  • At the node > prompt, I ran process.cwd(). This displayed: c:\\ and not c:\\test

When I saw c:\\ above, I remembered that I added an Autorun setting to HKEY_CURRENT_USER\Software\Microsoft\Command Processor in my Windows registry to automatically run a start up script every time cmd.exe is started. And when I looked at my start up script, I noticed that the last command in that script is: cd c:\.

After removing cd c:\ from my start up script, npm install node-sass ran correctly.

I don’t know how common my command prompt set up is. Regardless, it may be worthwhile to add what I discovered to the troubleshooting doc.