我刚买了一台新的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文件夹的权限。我还需要做些什么来解决这个错误?
发布于 2020-11-13 11:23:22
只需使用sudo npm install即可。
这样就可以了。
https://stackoverflow.com/questions/56415566
复制相似问题