创建新的 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时,出现以下错误:

npm 错误! 代码 ETARGET 呵呵!notarget 找不到 @angular-devkit/architect@0.803.12 的匹配版本 呵呵!notarget 在大多数情况下,您或您的依赖项之一正在请求 呵呵!no定位不存在的包版本。 呵呵!无目标 呵呵!notarget 它被指定为"@angular-devkit/build-angular"的依赖项 呵呵!无目标

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

以下是日志文件包含:

2488 详细类型版本 2489 详细堆栈 @angular-devkit/architect:找不到 @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 详细堆栈立即(内部/计时器.js:439:21( 2490 verbose cwd/Users/me/AngularLab/myWorkSpace/projectName 2491 详细达尔文 16.7.0 2492 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--quiet" 2493 详细节点 v12.13.0 2494 详细 npm v6.12.0 2495 错误代码 ETARGET 2496 错误 notarget 找不到 @angular-devkit/architect@0.803.12 的匹配版本。 2497 错误 notarget 在大多数情况下,您或您的依赖项之一正在请求 2497 错误 no定位不存在的包版本。 2497 错误 notarget 2497 错误 notarget 它被指定为"@angular-devkit/build-angular"的依赖项 2498 详细退出 [ 1,真 ]

知道我哪里出错了吗?

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

最新更新