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?
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
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "webpack" "webpack-dev-server"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "webpack" "webpack-dev-server"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! path npm-debug.log.1837435588
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.1837435588'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.1837435588'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.1837435588' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/npm-debug.log
lnkimac:Users fernando$
When you install something gloabally (-g), you have to launch npm with administrator rights (in most cases).
You can do this by starting a Commandline with administrator rights (Search CMD in Windows, right click it -> start as administrator).
There you can execute the command again. This should work.
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
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
~ $ 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.