gpt4 book ai didi

node.js - npm install 卡在提取 : zone. js

转载 作者:行者123 更新时间:2023-12-03 20:09:13 25 4
gpt4 key购买 nike

我不是 JS 专家,所以这个问题可能有一个简单的解决方案。我正在尝试 .Net Core Angular SPA 模板。当我尝试运行 npm install命令,它卡在 extract:zone.js步。这是命令输出。

D:\Projects\UI>cd ClientApp

D:\Projects\UI\ClientApp>npm install
[ ...........] / extract:zone.js: verb lock using C:\Users\rahul\AppData\Roaming\npm-cache\_locks\staging-f4d27da8ef6cdab8.lock for D:\Projects\UI\ClientApp\node_modules\.staging

我尝试重新安装 node 和 npm,但似乎没有什么不同。这是我的 Node 和 npm 版本。
D:\Projects\UI\ClientApp>npm version
{ AngularMaterial: '0.0.0',
npm: '6.4.1',
ares: '1.14.0',
cldr: '33.1',
http_parser: '2.8.0',
icu: '62.1',
modules: '64',
napi: '3',
nghttp2: '1.34.0',
node: '10.12.0',
openssl: '1.1.0i',
tz: '2018e',
unicode: '11.0',
uv: '1.23.2',
v8: '6.8.275.32-node.35',
zlib: '1.2.11' }

我没有在默认的 .net core Angular SPA 模板中添加或删除任何内容。感谢帮助。

更多详情
这是我已经尝试过的命令。
D:\Projects\UI\ClientApp>npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.

D:\Projects\UI\ClientApp>npm install --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\rahul\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--verbose' ]
npm info using npm@6.4.1
npm info using node@v10.12.0
npm verb npm-session 4b2214d86e04af5b
npm info lifecycle AngularMaterial@0.0.0~preinstall: AngularMaterial@0.0.0
npm timing stage:loadCurrentTree Completed in 12ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 494ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 678ms
npm timing stage:loadIdealTree Completed in 1408ms
npm timing stage:generateActionsToTake Completed in 352ms
npm verb correctMkdir C:\Users\rahul\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\rahul\AppData\Roaming\npm-cache\_locks\staging-f4d27da8ef6cdab8.lock for D:\Projects\NamitUI\ClientApp\node_modules\.staging
npm timing audit compress Completed in 233ms
npm info audit Submitting payload of 66762bytes
npm timing audit submit Completed in 1900ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1903ms
npm timing audit body Completed in 4ms
[ ...........] / extract:zone.js: timing audit body Completed in 4ms

运行带有 -ddd 标志的命令会生成类似的输出,最后几个步骤如下所示。这是完整日志的粘贴箱: https://pastebin.com/gnvn1wHe
npm sill tarball trying async-each@1.0.1 by hash: sha1-GdOGodntxufByF04iu28xW0zYC0=
npm sill tarball trying async-foreach@0.1.3 by hash: sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=
npm timing audit submit Completed in 2163ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 2014ms
npm timing audit body Completed in 4ms
[ ...........] / extract:zone.js: timing audit body Completed in 4ms

最佳答案

我有同样的问题,我通过更改注册表来修复它

http://registry.npmjs.org/


https://registry.npmjs.org/

要更改链接,您可以使用
npm config set registry <link>

或者你也可以打开 npm 的配置文件
notepad ~/.npmrc

并使用正确的链接更改注册表行。
registry=https://registry.npmjs.org/

我认为问题来自将我公司的代理添加到 npm。代理需要使用 https

关于node.js - npm install 卡在提取 : zone. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52901696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com