我刚买了一台新的Mac笔记本电脑。老实说,我对Mac操作系统不是很熟悉。现在我在运行npm install时遇到问题。我尝试通过在此链接Permission denied when installing npm modules in OSX下运行此命令来解决此问题。我可以进入下一步。现在错误出现在项目文件夹中。基本上,它没有桌面上项目文件夹的node_modules的权限。再次运行npm install时,出现此错误。
npm ERR! path /Users/wai/Desktop/easy-eat-backend-laravel/node_modules/@coreui/coreui/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/wai/Desktop/easy-eat-backend-laravel/node_modules/@coreui/coreui/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/Users/wai/Desktop/easy-eat-backend-laravel/node_modules/@coreui/coreui/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/Users/wai/Desktop/easy-eat-backend-laravel/node_modules/@coreui/coreui/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path:
npm ERR! '/Users/wai/Desktop/easy-eat-backend-laravel/node_modules/@coreui/coreui/node_modules' }
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文件夹上的权限。要解决此错误,我还需要做什么?
答案 0 :(得分:-2)
只需使用sudo npm install。
应该这样做