公告
财富商城
积分规则
提问
发文
2019-04-15 09:02发布
三岁会撩人
I am trying to run angular application and execute ng serve command then show
Error: Cannot find module 'node-sass'.
Try this : npm install node-sass@version .
if you want the latest, then just try npm install node-sass .
If you're getting access problem then:
Windows: command prompt in admin mode, then run the above.
Mac: sudo npm install node-sass.
ERROR in Cannot find module 'node-sass'
https://github.com/sass/node-sass/issues/603
On Reply :-
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/build' Ask Question
Solution :-
You need to change ownership of node_modules, because you use sudo npm install -g node-sass so its ownership set to root,
node_modules
sudo npm install -g node-sass
To change ownership to current user as group -
sudo chown -R root:YOUR_USERNAME /usr/local/lib/node_modules/ sudo chmod -R 775 /usr/local/lib/node_modules/
And never use sudo for npm related query.
sudo
npm
If you have not added node pakage.json yet try running node init if you already have this npm install node-sass. if both are present and you are using ubuntu try changing permission of the folder using chmod -R path to node module
I am working ionic and have this issue so I solved this by move one folder back and run command.
sudo chmod 777 -R project-directory
after this npm install node-sass --save
npm install node-sass --save
Try this
sudo npm install -g --unsafe-perm node-sass
Or this
sudo npm install -g --unsafe-perm --verbose @angular/cli
最多设置5个标签!
Try this : npm install node-sass@version .
if you want the latest, then just try npm install node-sass .
If you're getting access problem then:
Windows: command prompt in admin mode, then run the above.
Mac: sudo npm install node-sass.
ERROR in Cannot find module 'node-sass'
https://github.com/sass/node-sass/issues/603
On Reply :-
Solution :-
You need to change ownership of
node_modules
, because you usesudo npm install -g node-sass
so its ownership set to root,To change ownership to current user as group -
And never use
sudo
fornpm
related query.If you have not added node pakage.json yet try running node init if you already have this npm install node-sass. if both are present and you are using ubuntu try changing permission of the folder using chmod -R path to node module
I am working ionic and have this issue so I solved this by move one folder back and run command.
sudo chmod 777 -R project-directory
after this
npm install node-sass --save
Try this
Or this