Joeris-MacBook-Pro:~ Joericblom$ npm install -g coffee-script
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "coffee-script"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! path /usr/local/bin/coffee
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/local/bin/coffee'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, unlink '/usr/local/bin/coffee']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/local/bin/coffee' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, unlink '/usr/local/bin/coffee'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, unlink '/usr/local/bin/coffee']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'unlink',
npm ERR! error rolling back path: '/usr/local/bin/coffee' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Joericblom/npm-debug.log
Joeris-MacBook-Pro:~ Joericblom$
Can somebody help me with this?
The error says: Error: EACCES: permission denied.
You'll need admin rights to install globally, so you need to prepend your command with sudo.
Like this: sudo npm install -g coffee-script
Related
When I try to install adonis Cli I get this permison error:
npm ERR! path ../lib/node_modules/#adonisjs/cli/index.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/#adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/#adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/#adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/#adonisjs/cli/index.js',
npm ERR! dest: '/usr/bin/adonis' },
npm ERR! stack: 'Error: EACCES: permission denied, symlink \'../lib/node_modules/#adonisjs/cli/index.js\' -> \'/usr/bin/adonis\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/#adonisjs/cli/index.js',
npm ERR! dest: '/usr/bin/adonis' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/adroitcoder/.npm/_logs/2018-10-06T07_39_51_484Z-debug.log
For EACCES errors you should either reinstall npm with a Node version manager or change npm's default directory manually.
Credit: https://docs.npmjs.com/getting-started/fixing-npm-permissions
This has occured three times now.
I run npm install npm -g and it results in:
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm" "-g"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rmdir
npm ERR! Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/npm'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/npm']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rmdir',
npm ERR! path: '/usr/local/lib/node_modules/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/npm'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, rmdir '/usr/local/lib/node_modules/npm']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'rmdir',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/npm' }
I then input npm -v and it returns -bash: /usr/local/bin/npm: No such file or directory.
Im trying to upgrade to npm3.
Any ideas?
I have had node and npm on my system for a while, but I haven't used them in a while and they seem to be broken.
Today I would like to get back to it and while trying to install yeoman, I got a message that "Your npm version is outdated." and advice to run npm install -g npm.
So I did that and got a lot more errors:
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "npm"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! path /usr/local/lib/node_modules/npm/.mailmap
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.mailmap'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.mailmap']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/usr/local/lib/node_modules/npm/.mailmap' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.npmignore'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.npmignore']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'unlink',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/npm/.npmignore' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Dan/npm-debug.log
I then tried this too
// ♥ unlink '/usr/local/lib/node_modules/npm/.mailmap'
unlink: /usr/local/lib/node_modules/npm/.mailmap: Permission denied
Honestly, I can't remember whether I installed node with Homebrew or what else is on this thing. I think at some point I installed a node version manager but I could be wrong. Also, I always get nervous following instructions that say to use sudo. I can never remember which instructions to use sudo I'm supposed to not follow.
Any ideas?
Use sudo.
sudo npm install -g npm
All set. I just followed these instructions from John Papa and it's working now.
I am having many npm errors in the terminal while installing Apache cordova in my mac. I have also tried sudo npm install -g cordova but it's the same and Cordova is not installed while using Cordova --version
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! path /Users/macmini/.node/bin/cordova
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/Users/macmini/.node/bin/cordova' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back syscall: 'unlink',
npm ERR! error rolling back path: '/Users/macmini/.node/bin/cordova' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/macmini/npm-debug.log
~ $ npm install -g yo
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! node v0.12.5
npm ERR! npm v2.14.0
npm ERR! path /usr/local/lib/node_modules/yo
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, rmdir '/usr/local/lib/node_modules/yo'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, rmdir '/usr/local/lib/node_modules/yo']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/yo' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir '/usr/local/lib/node_modules/yo'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, rmdir '/usr/local/lib/node_modules/yo']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/yo' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Jagadeesh/npm-debug.log
Instead run the command as npm install -g yo. The error you are getting says:
"npm ERR! Please try running this command again as root/Administrator."
You will need to run as root to install this.