无法在范围中或依赖项中安装NPM软件包(或类似的内容)

时间:2018-11-28 12:02:01

标签: node.js npm

从今天早上开始,我发现我不再能够从作用域(或任何具有相关性的依赖项)中安装任何NPM软件包。例如,如果我输入npm i webpack,则会出现以下错误...

  

npm错误!代码E401 npm ERR! 401未经授权:   @ webassemblyjs / wasm-parser @ 1.7.11

     

npm错误!有关此运行的完整日志,请参见:npm ERR!
  C:\ Users \ tempo_000 \ AppData \ Roaming \ npm-cache_logs \ 2018-11-28T11_54_44_456Z-debug.log

日志有以下有趣的地方...

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'i',
1 verbose cli   'webpack' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose npm-session bda7db37888d1d27
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/webpack 16ms (from cache)
8 silly pacote range manifest for webpack@^4.11.1 fetched in 42ms
9 timing stage:loadCurrentTree Completed in 1037ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 4ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 332ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule webpack@4.26.1 checking installable status
17 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fast 45ms (from cache)
18 http fetch GET 200 https://registry.npmjs.org/acorn 46ms (from cache)
19 http fetch GET 200 https://registry.npmjs.org/acorn-dynamic-import 47ms (from cache)
20 http fetch GET 200 https://registry.npmjs.org/chrome-trace-event 49ms (from cache)
21 http fetch GET 200 https://registry.npmjs.org/ajv-keywords 49ms (from cache)
22 http fetch GET 200 https://registry.npmjs.org/ajv 49ms (from cache)
23 http fetch GET 200 https://registry.npmjs.org/enhanced-resolve 52ms (from cache)
24 silly pacote version manifest for @webassemblyjs/ast@1.7.11 fetched in 60ms
25 silly resolveWithNewModule @webassemblyjs/ast@1.7.11 checking installable status
26 silly pacote range manifest for acorn@^5.6.2 fetched in 60ms
27 silly resolveWithNewModule acorn@5.7.3 checking installable status
28 silly pacote range manifest for acorn-dynamic-import@^3.0.0 fetched in 62ms
29 silly resolveWithNewModule acorn-dynamic-import@3.0.0 checking installable status
30 silly pacote range manifest for chrome-trace-event@^1.0.0 fetched in 63ms
31 silly resolveWithNewModule chrome-trace-event@1.0.0 checking installable status
32 silly pacote range manifest for ajv-keywords@^3.1.0 fetched in 64ms
33 silly resolveWithNewModule ajv-keywords@3.2.0 checking installable status
34 silly pacote range manifest for ajv@^6.1.0 fetched in 65ms
35 silly resolveWithNewModule ajv@6.5.5 checking installable status
36 silly pacote range manifest for enhanced-resolve@^4.1.0 fetched in 66ms
37 silly resolveWithNewModule enhanced-resolve@4.1.0 checking installable status
38 http fetch GET 200 https://registry.npmjs.org/eslint-scope 18ms (from cache)
39 http fetch GET 200 https://registry.npmjs.org/json-parse-better-errors 18ms (from cache)
40 http fetch GET 200 https://registry.npmjs.org/loader-runner 17ms (from cache)
41 http fetch GET 200 https://registry.npmjs.org/memory-fs 17ms (from cache)
42 http fetch GET 200 https://registry.npmjs.org/loader-utils 17ms (from cache)
43 http fetch GET 200 https://registry.npmjs.org/micromatch 18ms (from cache)
44 http fetch GET 200 https://registry.npmjs.org/neo-async 17ms (from cache)
45 silly pacote range manifest for eslint-scope@^4.0.0 fetched in 27ms
46 silly resolveWithNewModule eslint-scope@4.0.0 checking installable status
47 silly pacote range manifest for json-parse-better-errors@^1.0.2 fetched in 33ms
48 silly resolveWithNewModule json-parse-better-errors@1.0.2 checking installable status
49 silly pacote range manifest for loader-runner@^2.3.0 fetched in 34ms
50 silly resolveWithNewModule loader-runner@2.3.1 checking installable status
51 silly pacote range manifest for memory-fs@~0.4.1 fetched in 34ms
52 silly resolveWithNewModule memory-fs@0.4.1 checking installable status
53 silly pacote range manifest for loader-utils@^1.1.0 fetched in 38ms
54 silly resolveWithNewModule loader-utils@1.1.0 checking installable status
55 silly pacote range manifest for micromatch@^3.1.8 fetched in 39ms
56 silly resolveWithNewModule micromatch@3.1.10 checking installable status
57 silly pacote range manifest for neo-async@^2.5.0 fetched in 39ms
58 silly resolveWithNewModule neo-async@2.6.0 checking installable status
59 http fetch GET 200 https://registry.npmjs.org/node-libs-browser 31ms (from cache)
60 http fetch GET 200 https://registry.npmjs.org/schema-utils 27ms (from cache)
61 http fetch GET 200 https://registry.npmjs.org/tapable 21ms (from cache)
62 http fetch GET 200 https://registry.npmjs.org/terser-webpack-plugin 22ms (from cache)
63 http fetch GET 200 https://registry.npmjs.org/webpack-sources 21ms (from cache)
64 http fetch GET 200 https://registry.npmjs.org/watchpack 21ms (from cache)
65 silly pacote range manifest for node-libs-browser@^2.0.0 fetched in 36ms
66 silly resolveWithNewModule node-libs-browser@2.1.0 checking installable status
67 silly pacote range manifest for tapable@^1.1.0 fetched in 26ms
68 silly resolveWithNewModule tapable@1.1.1 checking installable status
69 silly pacote range manifest for terser-webpack-plugin@^1.1.0 fetched in 28ms
70 silly resolveWithNewModule terser-webpack-plugin@1.1.0 checking installable status
71 silly pacote range manifest for schema-utils@^0.4.4 fetched in 36ms
72 silly resolveWithNewModule schema-utils@0.4.7 checking installable status
73 silly pacote range manifest for webpack-sources@^1.3.0 fetched in 30ms
74 silly resolveWithNewModule webpack-sources@1.3.0 checking installable status
75 silly pacote range manifest for watchpack@^1.5.0 fetched in 31ms
76 silly resolveWithNewModule watchpack@1.6.0 checking installable status
77 http fetch GET 401 https://registry.npmjs.org/@webassemblyjs%2fwasm-parser 147ms
78 silly fetchPackageMetaData error for @webassemblyjs/wasm-parser@1.7.11 401 Unauthorized: @webassemblyjs/wasm-parser@1.7.11
79 http fetch GET 401 https://registry.npmjs.org/@webassemblyjs%2fhelper-module-context 156ms
80 silly fetchPackageMetaData error for @webassemblyjs/helper-module-context@1.7.11 401 Unauthorized: @webassemblyjs/helper-module-context@1.7.11
81 http fetch GET 304 https://registry.npmjs.org/@webassemblyjs%2fwasm-edit 465ms (from cache)
82 silly pacote version manifest for @webassemblyjs/wasm-edit@1.7.11 fetched in 471ms
83 silly resolveWithNewModule @webassemblyjs/wasm-edit@1.7.11 checking installable status
84 timing stage:rollbackFailedOptional Completed in 1ms
85 timing stage:runTopLevelLifecycles Completed in 1867ms

如果我运行npm config list来检查注册表,则不存在本地或非标准配置...

; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.4.1 node/v8.12.0 win32 x64"

; userconfig C:\Users\tempo_000\.npmrc
email = "keith@ministryotech.co.uk"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Development\Training\Base Stacks\vanilla-scss
; HOME = C:\Users\tempo_000
; "npm config ls -l" to show all defaults.

昨天运行良好,我已经测试过,它不能在3个不同的项目中使用。

我已经安装了nvm,并尝试在节点8.12和10.11下执行相同的操作,并获得相同的结果。

1 个答案:

答案 0 :(得分:1)