我想安装@angular/cli
,但它不起作用,我已经重新安装了 Node,但问题仍然存在。
文本输出:
MacBook-Pro-de-MAC:~ macayoub$ npm -v
6.14.4
MacBook-Pro-de-MAC:~ macayoub$ node -v
v12.16.2
MacBook-Pro-de-MAC:~ macayoub$ sudo npm install -g @angular/cli
Password:
npm WARN deprecated <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cbb9aebabeaeb8bf8bf9e5f3f3e5f9" rel="noreferrer noopener nofollow">[email protected]</a>: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@angular/cli/bin/ng
npm ERR! dest /Users/macayoub/.npm-global/bin/ng
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/@angular/cli/bin/ng' -> '/Users/macayoub/.npm-global/bin/ng'
npm ERR! File exists: /Users/macayoub/.npm-global/bin/ng
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! /Users/macayoub/.npm/_logs/2020-04-21T08_23_36_422Z-debug.log
最佳答案
您需要从/usr/local/bin 中删除 ng 文件夹 再次安装
sudo rm -rf /usr/local/bin/ng
sudo npm i -g @angular/cli
在Angular CLI Error path and code EEXIST查找重复的问题
并回答:
https://stackoverflow.com/a/52621562/165260
还请避免发布重复的问题,首先在社区中搜索它们。 快乐编码!
关于node.js - NPM 无法安装 @angular/cli 并显示 "File already exists",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61339191/