2021-01-05

今天新加入一个项目,把项目clone后,安装依赖这一步失败了.报错:

npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-01-05T02_19_38_696Z-debug.log

2021-01-05_第1张图片

自己摸索一会,发现貌似是这个项目所在文件夹的权限问题.因为是公司的一台电脑,比较老,还是win7系统,为什么出现这个问题也不太清楚,

最后我的解决办法就是:

1.鼠标对着项目文件夹右键,点击属性;

2.选择 安全 ,,点击编辑,选中当前用户,将下方的权限全部打上勾

3.全部勾好之后点应用,最后进入项目重新npm i就可以正常安装啦!

2021-01-05_第2张图片

你可能感兴趣的:(node.js,webpack,npm)