node-sass: build fails on Debian 7.0 x64

As a root I do: npm -g install node-sass

Here is the result:

/root/.nvm/v0.10.26/bin/node-sass -> /root/.nvm/v0.10.26/lib/node_modules/node-sass/bin/node-sass

> node-sass@0.8.6 install /root/.nvm/v0.10.26/lib/node_modules/node-sass
> node build.js

sh: 1: node: Permission denied
npm ERR! node-sass@0.8.6 install: `node build.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the node-sass@0.8.6 install script.
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 build.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! System Linux 3.2.0-4-amd64
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "-g" "install" "node-sass"
npm ERR! cwd /root
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0

Any chance to fix it?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 28 (13 by maintainers)

Most upvoted comments

I got a similar error with (node 5.7.0, npm 3.7.3, node-sass@3.4.2, aliyun, ubuntu) like this:

npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN prefer global node-gyp@3.3.0 should be installed with -g

> node-sass@3.4.2 install /root/bsi-portal/bsi-portal/node_modules/node-sass
> node scripts/install.js

sh: 1: node: Permission denied
npm WARN mockup@1.0.0 No repository field.
npm ERR! Linux 3.13.0-65-generic
npm ERR! argv "/root/bsi-portal/nodejs/bin/node" "/root/bsi-portal/nodejs/bin/npm" "install" "node-sass"
npm ERR! node v5.7.0
npm ERR! npm  v3.7.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! node-sass@3.4.2 install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the node-sass@3.4.2 install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, 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!     /root/bsi-portal/bsi-portal/npm-debug.log

And after two days googling, i found this actually solved my problem, referred sourcode

npm config set user 0
npm config set unsafe-perm true