老卫同学
发布于 2024-07-04 / 65 阅读
0
0

使用n管理的node版本

npm总是权限有问题

npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice To update run: npm install -g npm@10.8.1
npm notice
npm error code EACCES
npm error syscall mkdir
npm error path /Users/oldwei/.npm/_cacache
npm error errno EACCES
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 501:20 "/Users/oldwei/.npm"

npm error Log files were not written due to an error writing to the directory: /Users/oldwei/.npm/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

然后根据提示执行了

sudo chown -R 501:20 "/Users/oldwei/.npm"


评论