创建新的Angular项目-软件包安装失败 [英] Create new Angular project - Package install failed

查看:59
本文介绍了创建新的Angular项目-软件包安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular CLI: 8.3.8
Node: 10.16.3
OS: darwin x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.8
@angular-devkit/core         8.3.8
@angular-devkit/schematics   8.3.8
@angular/cli                 8.3.8
@schematics/angular          8.3.8
@schematics/update           0.803.8

当我尝试创建一个新项目: ng new projectName 时,出现以下错误:

When I try to create a new project: ng new projectName, I get the following error:

npm ERR!代码ETARGETnpm ERR!没有找到与@ angular-devkit/architect @ 0.803.12匹配的版本npm ERR!notarget在大多数情况下,您或您的一个依赖项正在请求npm ERR!notarget不存在的软件包版本.npm ERR!没有目标npm ERR!notarget它被指定为"@ angular-devkit/build-angular"的依赖项npm ERR!无目标

npm ERR! code ETARGET npm ERR! notarget No matching version found for @angular-devkit/architect@0.803.12 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 '@angular-devkit/build-angular' npm ERR! notarget

npm ERR!可以在以下位置找到此运行的完整日志:npm ERR!/Users/me/.npm/_logs/2019-10-21T08_48_20_226Z-debug.log软件包安装失败,请参见上文.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/me/.npm/_logs/2019-10-21T08_48_20_226Z-debug.log Package install failed, see above.

这是包含以下内容的日志文件:

Here is the log file contains:

2488详细类型版本2489详细堆栈@ angular-devkit/architect:找不到与@ angular-devkit/architect @ 0.803.12匹配的版本.pickManifest上的2489详细堆栈(/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:122:13)2489详细堆栈位于/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:24:14tryCatcher上的2489详细堆栈(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)Promise._settlePromiseFromHandler(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)上的2489详细堆栈Promise._settlePromise(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)上的2489详细堆栈Promise._settlePromiseCtx上的2489详细堆栈(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:611:10)_drainQueueStep处的2489详细堆栈(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12)_drainQueue上的2489详细堆栈(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)Async._drainQueues上的2489详细堆栈(/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)2489 Instant.Async.drainQueues处的详细堆栈[作为_onImmediate](/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)processImmediate上的2489详细堆栈(internal/timers.js:439:21)2490详细的cwd/Users/me/AngularLab/myWorkSpace/projectName2491详细的达尔文16.7.02492详细argv"/usr/local/bin/node""/usr/local/bin/npm"安装""--quiet"2493详细节点v12.13.02494详细npm v6.12.02495错误代码ETARGET2496错误Notarget没有找到@ angular-devkit/architect @ 0.803.12的匹配版本.2497错误,没有目标在大多数情况下,您或您的一个依赖项正在请求2497错误Notarget软件包版本不存在.2497错误无目标2497错误notarget它被指定为'@ angular-devkit/build-angular'的依赖项2498详细出口[1,true]

2488 verbose type version 2489 verbose stack @angular-devkit/architect: No matching version found for @angular-devkit/architect@0.803.12. 2489 verbose stack at pickManifest (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:122:13) 2489 verbose stack at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:24:14 2489 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23) 2489 verbose stack at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31) 2489 verbose stack at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18) 2489 verbose stack at Promise._settlePromiseCtx (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:611:10) 2489 verbose stack at _drainQueueStep (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12) 2489 verbose stack at _drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9) 2489 verbose stack at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5) 2489 verbose stack at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14) 2489 verbose stack at processImmediate (internal/timers.js:439:21) 2490 verbose cwd /Users/me/AngularLab/myWorkSpace/projectName 2491 verbose Darwin 16.7.0 2492 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--quiet" 2493 verbose node v12.13.0 2494 verbose npm v6.12.0 2495 error code ETARGET 2496 error notarget No matching version found for @angular-devkit/architect@0.803.12. 2497 error notarget In most cases you or one of your dependencies are requesting 2497 error notarget a package version that doesn't exist. 2497 error notarget 2497 error notarget It was specified as a dependency of '@angular-devkit/build-angular' 2498 verbose exit [ 1, true ]

有什么想法请问我要去哪里错了?

Any idea please where I'am going wrong?

推荐答案

1.check node version
node -v

2.if not installed then follow the below 
Go to the Node.js Downloads page
Download Node.js for macOS by clicking the "Macintosh Installer" option
Run the downloaded Node.js .pkg Installer
Run the installer, including accepting the license, selecting the destination, and authenticating for the install.

3.check for npm
npm -v

4.install npm
npm install npm -g

这篇关于创建新的Angular项目-软件包安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆