1

I'm trying to install node-sass for using with Ionic but it is not possible.

I'm using nvm with node v4.0.0 and npm 3.8.0 and when I run sudo npm install -g node-sass I get this error

$ sudo npm install -g node-sass
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: lodash@ /home/xx/.nvm/versions/node/v4.0.0/lib/node_modules/node-sass/bin/node-sass

> [email protected] install /home/xx/.nvm/versions/node/v4.0.0/lib/node_modules/node-sass
> node scripts/install.js

module.js:338
    throw err;
          ^
Error: Cannot find module '/home/xx/.nvm/versions/node/v4.0.0/lib/node_modules/node-sass/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
/home/xx/.nvm/versions/node/v4.0.0/lib
└── (empty)

npm ERR! Linux 4.1.18-2-MANJARO
npm ERR! argv "/home/xx/.nvm/versions/node/v4.0.0/bin/node" "/home/xx/.nvm/versions/node/v4.0.0/bin/npm" "install" "-g" "node-sass"
npm ERR! node v4.0.0
npm ERR! npm  v3.8.0
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! 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!     /home/xx/npm-debug.log
npm ERR! code 1

Could you please help to solve this? it does not work either when using node v5.0.0

thanks

2
  • 1
    If you are using nvm, you don't need to use sudo. I just tried installing with npm install -g node-sass on my achine and evertyhing worked great. Try running npm cache clean if your problem persists Commented Mar 7, 2016 at 17:29
  • @FabioAntunes thanks a lot! this solved my problem. I did npm cache clean and then installed it without sudo and worked :) Commented Mar 8, 2016 at 22:08

2 Answers 2

1

Downgrade your node version to use node/0.12.10 ... You can use something like n to manage it..

npm install n

Sign up to request clarification or add additional context in comments.

Comments

1

Did you try sudo ln -s /usr/bin/nodejs /usr/bin/node? In my case this helped.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.