2

几乎我用“npm”运行的每个命令和一些用“ng”运行的命令都会返回这个错误。

我从 Nativescript 和 Angular 开始,我在这里很迷茫......

关于这些错误可能来自哪里的任何想法?

例如,尝试使用 Angular 创建一个新应用程序(“ng new angular-app”)

日志返回所有这些错误:

17 silly fetchPackageMetaData error for @angular-devkit/build-angular@~0.13.0 Cannot read property 'resolve' of undefined
18 silly fetchPackageMetaData error for @angular/cli@~7.3.4 Cannot read property 'resolve' of undefined
19 silly fetchPackageMetaData error for @angular/compiler-cli@~7.2.0 Cannot read property 'resolve' of undefined
20 silly fetchPackageMetaData error for @angular/language-service@~7.2.0 Cannot read property 'resolve' of undefined
21 silly fetchPackageMetaData error for @types/node@~8.9.4 Cannot read property 'resolve' of undefined
22 silly fetchPackageMetaData error for @types/jasmine@~2.8.8 Cannot read property 'resolve' of undefined
23 silly fetchPackageMetaData error for @types/jasminewd2@~2.0.3 Cannot read property 'resolve' of undefined
24 silly fetchPackageMetaData error for codelyzer@~4.5.0 Cannot read property 'resolve' of undefined
25 silly fetchPackageMetaData error for jasmine-core@~2.99.1 Cannot read property 'resolve' of undefined
26 silly fetchPackageMetaData error for jasmine-spec-reporter@~4.2.1 Cannot read property 'resolve' of undefined
27 silly fetchPackageMetaData error for karma@~4.0.0 Cannot read property 'resolve' of undefined
28 silly fetchPackageMetaData error for karma-chrome-launcher@~2.2.0 Cannot read property 'resolve' of undefined
29 silly fetchPackageMetaData error for karma-coverage-istanbul-reporter@~2.0.1 Cannot read property 'resolve' of undefined
30 silly fetchPackageMetaData error for karma-jasmine@~1.1.2 Cannot read property 'resolve' of undefined
31 silly fetchPackageMetaData error for karma-jasmine-html-reporter@^0.2.2 Cannot read property 'resolve' of undefined
32 silly fetchPackageMetaData error for protractor@~5.4.0 Cannot read property 'resolve' of undefined
33 silly fetchPackageMetaData error for ts-node@~7.0.0 Cannot read property 'resolve' of undefined
34 silly fetchPackageMetaData error for tslint@~5.11.0 Cannot read property 'resolve' of undefined
35 silly fetchPackageMetaData error for typescript@~3.2.2 Cannot read property 'resolve' of undefined
36 silly fetchPackageMetaData error for @angular/animations@~7.2.0 Cannot read property 'resolve' of undefined
37 silly fetchPackageMetaData error for @angular/common@~7.2.0 Cannot read property 'resolve' of undefined
38 silly fetchPackageMetaData error for @angular/compiler@~7.2.0 Cannot read property 'resolve' of undefined
39 silly fetchPackageMetaData error for @angular/core@~7.2.0 Cannot read property 'resolve' of undefined
40 silly fetchPackageMetaData error for @angular/forms@~7.2.0 Cannot read property 'resolve' of undefined
41 silly fetchPackageMetaData error for @angular/platform-browser@~7.2.0 Cannot read property 'resolve' of undefined
42 silly fetchPackageMetaData error for @angular/platform-browser-dynamic@~7.2.0 Cannot read property 'resolve' of undefined
43 silly fetchPackageMetaData error for @angular/router@~7.2.0 Cannot read property 'resolve' of undefined
44 silly fetchPackageMetaData error for core-js@^2.5.4 Cannot read property 'resolve' of undefined
45 silly fetchPackageMetaData error for rxjs@~6.3.3 Cannot read property 'resolve' of undefined
46 silly fetchPackageMetaData error for tslib@^1.9.0 Cannot read property 'resolve' of undefined
47 silly fetchPackageMetaData error for zone.js@~0.8.26 Cannot read property 'resolve' of undefined
48 silly fetchPackageMetaData error for @angular/animations@~7.2.0 Cannot read property 'resolve' of undefined
49 silly fetchPackageMetaData error for @angular/common@~7.2.0 Cannot read property 'resolve' of undefined
50 silly fetchPackageMetaData error for @angular/compiler@~7.2.0 Cannot read property 'resolve' of undefined
51 silly fetchPackageMetaData error for @angular/core@~7.2.0 Cannot read property 'resolve' of undefined
52 silly fetchPackageMetaData error for @angular/forms@~7.2.0 Cannot read property 'resolve' of undefined
53 silly fetchPackageMetaData error for @angular/platform-browser@~7.2.0 Cannot read property 'resolve' of undefined
54 silly fetchPackageMetaData error for @angular/platform-browser-dynamic@~7.2.0 Cannot read property 'resolve' of undefined
55 silly fetchPackageMetaData error for @angular/router@~7.2.0 Cannot read property 'resolve' of undefined
56 silly fetchPackageMetaData error for core-js@^2.5.4 Cannot read property 'resolve' of undefined
57 silly fetchPackageMetaData error for rxjs@~6.3.3 Cannot read property 'resolve' of undefined
58 silly fetchPackageMetaData error for tslib@^1.9.0 Cannot read property 'resolve' of undefined
59 silly fetchPackageMetaData error for zone.js@~0.8.26 Cannot read property 'resolve' of undefined

63 verbose stack TypeError: Cannot read property 'resolve' of undefined
63 verbose stack     at regFetch (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\npm-registry-fetch\index.js:76:23)
63 verbose stack     at fetchPackument (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\lib\fetchers\registry\packument.js:42:10)
63 verbose stack     at packument (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\lib\fetchers\registry\packument.js:20:10)
63 verbose stack     at getManifest (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:22:10)
63 verbose stack     at manifest (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:13:10)
63 verbose stack     at Object.manifest (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\lib\fetchers\registry\index.js:17:12)
63 verbose stack     at Object.Fetcher#manifest [as manifest] (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\genfun\lib\genfun.js:15:38)
63 verbose stack     at manifest (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\lib\fetch.js:23:18)
63 verbose stack     at pinflight (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\pacote\manifest.js:24:12)
63 verbose stack     at C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
63 verbose stack     at Promise._execute (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\bluebird\js\release\debuggability.js:313:9)
63 verbose stack     at Promise._resolveFromExecutor (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\bluebird\js\release\promise.js:483:18)
63 verbose stack     at new Promise (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\bluebird\js\release\promise.js:79:10)
63 verbose stack     at _inflight (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
63 verbose stack     at C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
63 verbose stack     at tryCatcher (C:\Users\Marta\AppData\Roaming\nvm\v11.10.1\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
4

2 回答 2

2

需要更新 npm:

npm install npm -g

如果您使用的是 mac 或 linux,请使用 sudo

于 2019-03-03T05:03:42.200 回答
1

我有这个问题。解决方案是重新安装 Node JS。

安装 node 的最佳方法是从网站下载它:https ://nodejs.org

如果您需要特定版本,您可以从发布页面下载您需要的版本:https ://nodejs.org/en/download/releases/ 。

于 2019-06-04T13:41:54.117 回答