I tried to install express using terminal, but I keep getting this error message. I'm not familiar with terminal, I have no idea how can I fix this.
camila-ui-MacBook-Pro:myapp camila$ sudo chown -R $camila /usr/local
usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhv] [-R [-H | -L | -P]] :group file ...
camila-ui-MacBook-Pro:myapp camila$ npm install
npm WARN locking Error: EACCES: permission denied, open '/Users/camila/.npm/_locks/staging-ecf78f8592840908.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/camila/.npm/_locks/staging-ecf78f8592840908.lock failed { Error: EACCES: permission denied, open '/Users/camila/.npm/_locks/staging-ecf78f8592840908.lock'
npm WARN locking at Error (native)
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking syscall: 'open',
npm WARN locking path: '/Users/camila/.npm/_locks/staging-ecf78f8592840908.lock' }
npm WARN enoent ENOENT: no such file or directory, open '/Users/camila/package.json'
npm WARN camila No description
npm WARN camila No repository field.
npm WARN camila No README data
npm WARN camila No license field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3
npm ERR! path /Users/camila/.npm/_locks/staging-ecf78f8592840908.lock
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/Users/camila/.npm/_locks/staging-ecf78f8592840908.lock'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, open '/Users/camila/.npm/_locks/staging-ecf78f8592840908.lock'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/Users/camila/.npm/_locks/staging-ecf78f8592840908.lock' }
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" "install"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3
npm ERR! path npm-debug.log.2501560768
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2501560768'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.2501560768'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.2501560768' }
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/camlia/myapp/npm-debug.log
以root身份运行命令,因此命令将为sudo npm install
You should NOT use sudo
for npm install
. Try fixing-npm-permissions
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.