收到“npm ERR! ng 新项目上的代码 ENOVERSIONS”

问题描述 投票:0回答:2

每当我启动任何有角度的新项目时,我都会收到此错误。


npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for timed-out

例如:-

     ng new training-app
    installing ng2
      create .editorconfig
      create README.md
      create src\app\app.component.css
      create src\app\app.component.html
      create src\app\app.component.spec.ts
      create src\app\app.component.ts
      create src\app\app.module.ts
      create src\assets\.gitkeep
      create src\environments\environment.prod.ts
      create src\environments\environment.ts
      create src\favicon.ico
      create src\index.html
      create src\main.ts
      create src\polyfills.ts
      create src\styles.css
      create src\test.ts
      create src\tsconfig.json
      create angular-cli.json
      create e2e\app.e2e-spec.ts
      create e2e\app.po.ts
      create e2e\tsconfig.json
      create .gitignore
      create karma.conf.js
      create package.json
      create protractor.conf.js
      create tslint.json
    Successfully initialized git.
    Installing packages for tooling via npm.
    npm WARN deprecated [email protected]: angular-cli has been renamed to @angular/cli. Please update your dependencies.
    npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm ERR! code ENOVERSIONS
    npm ERR! No valid versions available for timed-out

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Yaso\AppData\Roaming\npm-cache\_logs\2018-01-06T19_29_46_895Z-debug.log

    Package install failed, see above.

到目前为止我所尝试过的

我尝试使用更新 npm

npm install npm@next -g

但仍然没有遇到同样的问题,同样的 git 上的问题

angularjs node.js npm git-bash
2个回答
1
投票

我遇到了同样的问题,然后我为其配置了注册表。尝试运行此命令。 “ npm 配置集注册表 https://registry.npmjs.org/


0
投票

最终通过在安装行添加 --no-cache 解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.