在 IdealTree 模块进行 npm 安装期间,节点管理器卡住了

问题描述 投票:0回答:2

这里是新的 mac 用户。我正在尝试在 phpstorm (laravel/laravel) 中创建一个作曲家项目,但每次我运行

npm install
时,该过程都会卡在:

npm timing idealTree:userRequests Completed in 0ms
⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠸ idealTree:stuttard_staging: sill idealTree buildDeps

完整的错误报告(大约 10 分钟冻结后):

npm timing idealTree:buildDeps Completed in 1181143ms
npm timing idealTree:fixDepFlags Completed in 1ms
npm timing idealTree Completed in 1181150ms
npm timing command:i Completed in 1181156ms
npm verb type system
npm verb stack FetchError: request to http://registry.npmjs.org/axios failed, reason: connect ETIMEDOUT 2606:4700::6810:1123:80
npm verb stack     at ClientRequest.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:110:14)
npm verb stack     at ClientRequest.emit (node:events:390:28)
npm verb stack     at Socket.socketErrorListener (node:_http_client:447:9)
npm verb stack     at Socket.emit (node:events:402:35)
npm verb stack     at emitErrorNT (node:internal/streams/destroy:164:8)
npm verb stack     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
npm verb stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm verb cwd /Users/artur/PhpstormProjects/stuttard_staging
npm verb Darwin 20.6.0
npm verb argv "/opt/homebrew/Cellar/node/17.2.0/bin/node" "/opt/homebrew/bin/npm" "i" "--verbose"
npm verb node v17.2.0
npm verb npm  v8.1.4
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to http://registry.npmjs.org/axios failed, reason: connect ETIMEDOUT 2606:4700::6810:1123:80
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm verb exit 1
npm timing npm Completed in 1181269ms
npm verb unfinished npm timer reify 1638537601466
npm verb unfinished npm timer reify:loadTrees 1638537601470
npm verb code 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/artur/.npm/_logs/2021-12-03T13_39_42_628Z-debug.log

这个问题似乎自节点版本以来就存在了

14+
。我将
node 17.2
npm 8.1.4
一起使用,似乎仍然明白。有些线程告诉我删除我没有的
package-lock.json
文件夹。

我尝试配置注册表:

npm config set registry http://registry.npmjs.org/

或清除缓存:

npm cache clear --force

但似乎没有什么帮助。我已经尝试了这些线程中提供的所有解决方案,但没有成功:

git 3359

git 17228

npm 安装挂在 IdealTree 上

这可能是我的网络配置问题吗?正如我所说,我是 mac 菜鸟。有什么办法可以查吗?

编辑:

我可以通过降级到古老的软件来让它工作:

node 14.17.4
npm 6.14.14

这只是一个临时修复,我很想知道如何使其与当前的软件版本一起工作。

node.js npm npm-install
2个回答
1
投票

将节点升级到 v16 后遇到一些问题。

删除

~/.npmrc
~/.node/etc/npmrc
文件中的所有配置修复此问题。


0
投票

就我而言,问题是互联网连接(网络安全组)。 另外,如果您的 ipv6 是默认值并且没有可用的 ipv6 也可能会导致此问题。 因此,首先检查互联网连接,要么 ping (如果允许 ICMP),要么使用curl 来获取类似 https://registry.npmjs.org 的地址,这是 npm 的存储库。

© www.soinside.com 2019 - 2024. All rights reserved.