Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

node.js - npm install -g sass Mac Os

When I want to install npm with the command npm install -g sass, I get the following message: Error: EROFS: read-only file system, mkdir '/user'

Cannot install sass I tried to change the default directory to install my packages.

Here are the manipulations I did to create the new one default directory.

I created a "npm-global" directory with mkdir npm-global.

Then I set this directory as a prefix with the command npm config set prefix /Users/your_username/npm-global.

To execute the commands of the installed packages, I added this directory to the directory list of our $PATH variable.

I switched to vi ~/.profile . In the profile file, I added the export line PATH=/USERS/myuser/npm-global/bin:$PATH.

I refreshed with source ~/.profile.

Is it possible to reset npm by default and thus no longer have this problem?

Thank you for your help.

question from:https://stackoverflow.com/questions/65887587/npm-install-g-sass-mac-os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...