-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Error: EACCES, mkdir '/usr/local/lib/node_modules/node-sass' - installing globally #1098
Comments
Sounds like you don't have permissions. You may have sudo npm installed
|
If I remember right, I only used sudo command to upgrade Node.js, according to this post http://stackoverflow.com/questions/8191459/how-to-update-node-js
Anyhow, I uninstalled Node.js and started over but still have the same issue. |
First you need to check your permissions is If you decide to run |
The npm documentation on permissions did the trick. |
🎉 |
I have the same problem today: Unable to save binary /usr/lib/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:891:18)
at sync (/usr/lib/node_modules/node-sass/node_modules/mkdirp/index.js:71:13)
at Function.sync (/usr/lib/node_modules/node-sass/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/usr/lib/node_modules/node-sass/scripts/install.js:111:11)
at Object.<anonymous> (/usr/lib/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/lib/node_modules/node-sass/vendor' } It only happens with npm -v: 5.3.0
node -v: v8.3.0
npm list -g --depth=0:
/usr/lib
├── atom-package-manager@1.18.3
├── autoprefixer@7.0.1
├── babel-cli@6.24.1
├── cordova@7.0.0
├── create-react-app@1.4.0
├── create-react-native-app@1.0.0
├── foundation-cli@2.2.2
├── gulp@4.0.0-alpha.2 (git+https://github.com/gulpjs/gulp.git#38246c3f8b6dbb8d4ef657183e92d90c8299e22f)
├── marked@0.3.6
├── marked-man@0.2.1
├── npm@5.3.0
├── postcss-cli@4.0.0
├── react-native-cli@2.0.1
├── semver@5.4.1
├── webpack@3.5.4
└── yarn@0.28.4 |
@SalahAdDin read the above and check the permissions |
@saper Yes, i haven't problems with any permission in the other packages installation, also with |
Because if you run npm as root (to able to install globally I guess) npm will switch to user nobody when executing scripts. Other packages either have no scripts in their package.json file or do not need to create additional files in the protected system directories. |
JIC someone's searching for the node permission docs everyone is talking about. https://docs.npmjs.com/getting-started/fixing-npm-permissions |
i solved my problem with the installation of node-sass. |
so i used to have to "sudo" npm everything, updated node and npm and now i dont have to use "sudo" anymore. thats it. |
I solved this issue by running |
Hi, I am trying to install node-sass globally but when I execute this command : npm install node-sass -g
I get the following error :
NB : I don't get any error when I install it locally though...
Can someone help me ?
The text was updated successfully, but these errors were encountered: