【问题标题】:Angular cant make new projectAngular 无法创建新项目
【发布时间】:2018-09-28 06:51:28
【问题描述】:

我尝试像这样使用 AngularCLI 制作新项目:

新的我的应用程序梦想

结果是:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning UNABLE_TO_VERIFY_LEAF_SIGNATURE: request to https://registry.npmjs.org/@angular-devkit%2fbuild-angular failed, reason: unable to verify the first certificate
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @angular/core@^6.1.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'my-app-dream'
npm ERR! notarget

npm ERR! A complete log of this run can be found in:
npm ERR!    %appdata%\npm-cache\_logs\2018-09-28T06_46_24_071Z-debug.log
Package install failed, see above.

【问题讨论】:

  • 你有什么版本的npm和node?​​span>

标签: node.js angular angular4-httpclient


【解决方案1】:

运行npm install -g @angular/cli

【讨论】:

  • npx @angular/cli@latest new my-proj 的更好选择。这将做同样的事情,但不会污染全局范围
【解决方案2】:

你能打开一个终端然后做吗

cat %appdata%\Roaming\npm-cache\_logs\2018-09-28T06_46_24_071Z-debug.log

然后发布结果?

由于它抱怨找不到与@angular/core 匹配的版本,可能是您没有正确安装angular,也许您可​​以尝试使用以下命令重新安装angular CLI,然后重试。

npm install -g @angular/cli

希望对你有帮助:)

【讨论】:

    猜你喜欢
    • 2018-10-31
    • 2017-08-14
    • 2020-02-21
    • 2019-03-06
    • 1970-01-01
    • 1970-01-01
    • 2018-07-28
    • 1970-01-01
    相关资源
    最近更新 更多