gpt4 book ai didi

node.js - 安装 Angular CLI 时收到错误警告

转载 作者:行者123 更新时间:2023-12-02 10:01:13 27 4
gpt4 key购买 nike

我是这个平台的新手。

我安装了Node.js,但是当我尝试运行命令npm install -g @angular/cli我收到此错误:

**npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN rollback Rolling back @schematics/angular@9.0.6 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Vivek\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@sche**

此外,当我尝试运行版本的命令时

它告诉我

**C:\Users\Vivek>ng v
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'C:\Users\Vivek\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng'**

最佳答案

试试这个...

要将所有软件包更新到新的主要版本,请全局安装 npm-check-updates 软件包:

npm install -g npm-check-updates

然后运行ncu:

ncu -u  --packageFile package.json

这会将 package.json 文件中的所有版本提示升级为依赖项和 devDependency,以便 npm 可以安装新的主要版本。您现在已准备好运行更新:

npm update

忽略任何审核建议并再次运行安装...

npm install

这应该是弃用警告。

关于node.js - 安装 Angular CLI 时收到错误警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60737168/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com