the*_*oid 11 node.js npm-install angular-cli
使用命令提示符,我正在尝试安装角度CLI,但它失败了.我有npm版本5.5.1和节点版本v8.9.1.我正在尝试使用该命令安装angular cli
npm install -g @ angular/cli @ latest
它失败并出现错误:
错误的ERR!代码E404 npm ERR!找不到404:@ angular/cli @ latest npm ERR!可以在以下位置找到此运行的完整日志:
我查看日志文件,我看到它试图从不存在的位置获取包.不知道从哪里拉.如何修复此位置路径并安装角度cli.当我尝试安装typescript或任何其他npm包时也会发生同样的情况.所有这些都尝试从下面提到的位置安装,它失败了404
8 http fetch GET 404
http://nuget.feed.xyz.corp:8729/npm/FeedNPM/@angular%2fcli 109ms
9 silly fetchPackageMetaData error for @angular/cli@latest 404 Not Found:
@angular/cli@latest
10 verbose stack Error: 404 Not Found: @angular/cli@latest
Run Code Online (Sandbox Code Playgroud)
小智 21
npm config set registry http://registry.npmjs.org
Run Code Online (Sandbox Code Playgroud)
首先尝试此命令(在 Windows 中以管理员身份运行)
npm config set registry http://registry.npmjs.org
npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
如果仍然不起作用,让我们通过运行此命令来更新 NPM 和 nodejs
npm -g install npm
npm cache clean -f
npm install -g n
Run Code Online (Sandbox Code Playgroud)
然后尝试运行
npm install -g @angular/cli
Run Code Online (Sandbox Code Playgroud)
这应该可以解决这个问题
.npmrc
在项目的根目录中添加一个文件。.npmrc
将如下所示 -
@xy:registry=https://xyz.jfrog.io/xyz/api/npm/npm-local/ @xy-app:registry=https://xyz.jfrog.io/xyz/api/npm/npm-当地的/
并删除所有字段,例如 - email 、 auth 等。找出您的应用程序的注册表 url 并将其放入注册表中。
然后运行命令 - npm install
它就会起作用。
归档时间: |
|
查看次数: |
34917 次 |
最近记录: |