Node.js Angular8节点js和npm安装问题
我在学英语。为此,我安装了nodejs和git。我在CMD上运行了以下命令:Node.js Angular8节点js和npm安装问题,node.js,angular,Node.js,Angular,我在学英语。为此,我安装了nodejs和git。我在CMD上运行了以下命令: npm install -g @angular/cli@latest 一段时间后,出现了以下错误 npm WARN rollback Rolling back @schematics/angular@8.3.21 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\User Name\AppDa
npm install -g @angular/cli@latest
一段时间后,出现了以下错误
npm WARN rollback Rolling back @schematics/angular@8.3.21 failed (this is
probably harmless): EPERM: operation not permitted, lstat 'C:\Users\User
Name\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@schematics'
npm ERR! code EEXIST
npm ERR! path C:\Users\User
Name\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
npm ERR! dest C:\Users\User Name\AppData\Roaming\npm\ng.ps1
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\Chaitanya
Kulkarni\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng' ->
'C:\Users\Chaitanya Kulkarni\AppData\Roaming\npm\ng.ps1'
npm ERR! File exists: C:\Users\User Name\AppData\Roaming\npm\ng.ps1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User Name\AppData\Roaming\npm-cache\_logs\2020-01-
04T12_12_30_922Z-debug.log
你能解释一下这个错误是什么,以及我如何解决这个问题吗。我正在使用窗口10。您可以尝试以管理员权限打开命令提示符,然后运行命令。执行以下步骤:
npm卸载-g angular cli
npm缓存清理--强制执行
npm i@angular/cli@latest-g
尝试在终端中运行以下命令
npm安装-g@angular/cli@latest--在终端中强制
导航到以下路径:
C:\Users\UserName\AppData\Roaming\npm\node\u模块
然后删除文件并重新安装cli。
这对我很管用
还要检查您是否正确设置了路径变量。运行此命令,如果不起作用,请手动删除现有文件 从计算机上完全卸载angular cli
npm uninstall -g angular-cli
清除npm缓存
npm cache clean --force
重新安装angular cli
npm i @angular/cli@latest -g
删除该位置的文件
C:\Users\Chaitanya Kulkarni\AppData\Roaming\npm\ng.ps1
谢谢你的建议,但我也试过了,但不起作用。同样的错误也发生了。也没有帮助。这可以帮助作者,但从技术角度来说是无用的。它没有说明为什么会出现问题以及为什么解决方案有效<代码>重新启动计算机也会有所帮助。遵循这种方法,开发人员可以放松时机来提高技能。我不否认您的建议,但这应该是最后一个选项。当我运行命令npm cache clean--force然后npm WARN using--force时,我当然希望您知道自己在做什么。您能告诉我当您强制运行npm cache clean命令时出现警告的错误是什么吗-f选项强制指定。为了使此解决方案完全工作,我必须添加到重新安装命令“-force”。尝试了该操作,但npm没有按照承诺覆盖文件。至少不在windows上。请在它前面尝试sudo