不管安装脚手架还是webpack都报错,解决办法如下:
code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/bin/webpack
It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in: /usr/local/bin/node/node_cache/_logs/2023-12-30T09_19_57_197Z-debug-0.log
在终端运行
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
以后输入自己要安的即可!