gpt4 book ai didi

node.js - Node js Express 安装错误 'EACCES'、 'no such file'

转载 作者:太空宇宙 更新时间:2023-11-03 22:29:21 24 4
gpt4 key购买 nike

我尝试使用终端安装express,但我不断收到此错误消息。我对终端不熟悉,我不知道如何解决这个问题。

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

最佳答案

您不应该使用 sudo 进行 npm install。试试fixing-npm-permissions

关于node.js - Node js Express 安装错误 'EACCES'、 'no such file',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39929509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com