关于linux mac npm提示access权限

1,238 阅读1分钟

错误: Error: EACCES: permission denied, mkdir node_modules/fsevents/build
原因:npm install的时候不需要sudo权限,否则会造成权限异常,无法写入。 Troubleshoot:

  1. li -al

  1. 需要修改owner为自己,即change own命令chown frankgo ....后面是文件夹(也可以这样,未测试 chmod -R 777 project-directory)

  2. 然后使用npm i,不能用sudo;如果不行则删除后重新来过

For drwxr-xr-x it is:

chmod 755  the_path_to_target
For drwxrwxr-x it is:

chmod 775  the_path_to_target