简体   繁体   English

Npm install angular/cli 错误 EPERM 不允许操作

[英]Npm install angular/cli error EPERM Operation not permitted

4399 error Error: EPERM: operation not permitted, unlink 'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules.staging\\tmp-5fcc012e\\README.md' 4399 error { Error: EPERM: operation not permitted, unlink 'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules.staging\\tmp-5fcc012e\\README.md' 4399 error cause: 4399 error { Error: EPERM: operation not permitted, unlink 'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules.staging\\tmp-5fcc012e\\README.md' 4399 error errno: -4048, 4399 error code: 'EPERM', 4399 error syscall: 'unlink', 4399 error path: 'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules\\.staging\\tmp-5fcc012e\\README.md' }, 4399 error stack: 'Error: EPERM: operation not permitted, unlink \\'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules\\.staging\\tmp-5fcc012e\\README.md\\'', 4399 error errno: -4048, 4399 error code: 'EPERM', 4399 error 4399 错误错误:EPERM:不允许操作,取消链接 'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules.staging\\tmp-5fcc012e\\README.md' 4399 错误 { 错误:EPERM:不允许操作,取消链接 ' C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules.staging\\tmp-5fcc012e\\README.md' 4399 错误原因:4399 error { Error: EPERM: operation not allowed, unlink 'C:\\Users\\deven\\AppData \\Roaming\\npm\\node_modules.staging\\tmp-5fcc012e\\README.md' 4399 error errno: -4048, 4399 error code: 'EPERM', 4399 error syscall: 'unlink', 4399 error path: 'C:\\Users\\ dev\\AppData\\Roaming\\npm\\node_modules\\.staging\\tmp-5fcc012e\\README.md'},4399 错误堆栈:'错误:EPERM:操作不允许,取消链接 \\'C:\\Users\\deven\\AppData\\Roaming\\ npm\\node_modules\\.staging\\tmp-5fcc012e\\README.md\\'', 4399 错误 errno: -4048, 4399 错误代码: 'EPERM', 4399 错误
syscall: 'unlink', 4399 error path: 'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules\\.staging\\tmp-5fcc012e\\README.md', 4399 error parent: '@angular/cli' } 4400 error The operation was rejected by your operating system.系统调用:'unlink',4399 错误路径:'C:\\Users\\deven\\AppData\\Roaming\\npm\\node_modules\\.staging\\tmp-5fcc012e\\README.md',4399 错误父级:'@angular/cli'} 4400错误 该操作被您的操作系统拒绝。 4400 error It's possible that the file was already in use (by a text editor or antivirus), 4400 error or that you lack permissions to access it. 4400 错误 文件可能已在使用中(由文本编辑器或防病毒软件)、4400 错误或您没有访问它的权限。 4400 error 4400 error If you believe this might be a permissions issue, please double-check the 4400 error permissions of the file and its containing directories, or try running 4400 error the command again as root/Administrator (though this is not recommended). 4400 错误 4400 错误 如果您认为这可能是权限问题,请仔细检查文件及其包含目录的 4400 错误权限,或尝试以 root/管理员身份再次运行 4400 错误命令(尽管不推荐这样做)。 4401 verbose exit [ -4048, true ] 4401 详细退出 [ -4048, true ]

由于您使用的是Windows ,您必须以as administrator身份启动终端as administrator然后重试即可。

It seems like this is a problem with npm.这似乎是 npm 的问题。 Try deleting your node_modules folder and running npm install again.尝试删除您的 node_modules 文件夹并再次运行npm install This should fix the problem.这应该可以解决问题。

It may be possible that your package.json is open in some editor.您的 package.json 可能在某个编辑器中打开。 Close it and then run the npm command again.关闭它,然后再次运行 npm 命令。

Try to uninstall the CLI using:尝试使用以下命令卸载 CLI:

npm uninstall -g @angular/cli

and reinstall using:并使用以下方法重新安装:

npm install -g @angular/cli

and also try to update npm to latest version并尝试将npm更新到最新版本

npm cache clean --force

npm install -g npm@latest
  1. Launch your code editor (eg.. Visual Studio Code) as Administrator.以管理员身份启动您的代码编辑器(例如……Vis​​ual Studio Code)。
  2. npm install -g @vue/cli. npm install -g @vue/cli.
  3. vue create yourprojectname. vue 创建您的项目名称。

Please try following steps:请尝试以下步骤:

  1. Delete node_modules删除 node_modules
  2. Do npm cache clean --force做 npm 缓存清理 --force
  3. Restart the PC重启电脑
  4. Try again npm install , now modules will install without any issues再试一次npm install ,现在模块将安装没有任何问题

(optional) - If you are behind VPN and not using any private registry , exit VPN and do npm install after restarting pc (可选)-如果您使用 VPN 并且不使用任何私有注册表,请退出 VPN 并在重新启动电脑后执行npm install

It solved for me when I made this: Right-click on - What ever program I use - and select Run as Administrator.当我这样做时,它为我解决了:右键单击 -我使用的任何程序- 并选择以管理员身份运行。 Personally I made it on PowerShell, but I assume that it works this way on any program我个人是在 PowerShell 上制作的,但我认为它可以在任何程序上以这种方式工作

I had opened the project in multiple terminals.我在多个终端中打开了该项目。 Later after closing all the respective terminals and running 'npm i', things started to work well.稍后在关闭所有相应的终端并运行“npm i”后,事情开始运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM