Cli: 全部捕获:“ npm ERR!cb()从未调用!”

创建于 2019-11-08  ·  29评论  ·  资料来源: npm/cli

使用此票证可解决此类错误。 有关它们的所有相关信息都应包含在本期中。

  Original bug ticket: [https://npm.community/t/9355](https://npm.community/t/9355)
  Originally filed: 2019-08-07T17:15:54.842Z

从原始发行版开始: https :
调试日志: 2019-08-07T17_07_58_949Z-debug.log
触发的动作: npm audit fix

平台信息:

$ npm --versions
{ 'next-boilerplate': '1.0.0',
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  modules: '64',
  napi: '4',
  nghttp2: '1.34.0',
  node: '10.16.1',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.28.0',
  v8: '6.8.275.32-node.54',
  zlib: '1.2.11' }
$ node -p process.platform
linux
Bug Community Release 6.x

最有用的评论

对我来说,这是在我尝试通过VPN通过企业代理npm install时发生的(实际上,代理似乎无关紧要)。 NPM在程序包尝试下载二进制文件时(例如,对于我来说为https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-79_binding.node)感到窒息。安装后步骤(不知道它是否与软件包相关)。

关闭VPN(全局保护)和代理后,一切正常进行。

开启代理和VPN❌

$ npm i node-sass
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\---\AppData\Roaming\npm-cache\_logs\2020-03-16T23_37_35_801Z-debug.log

image

image

image

2020-03-16T23_37_35_801Z-debug.log

关闭代理和VPN✔

$ npm i node-sass
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

> [email protected] install C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-79_binding.node
Download complete
Binary saved to C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Caching binary to C:\Users\---\AppData\Roaming\npm-cache\node-sass\4.13.1\win32-x64-79_binding.node

> [email protected] postinstall C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Testing binary
Binary is fine
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 173 packages from 137 contributors and audited 528 packages in 16.034s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

image

仅限代理✔

$ npm i node-sass
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

> [email protected] install C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-79_binding.node
Download complete
Binary saved to C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Caching binary to C:\Users\---\AppData\Roaming\npm-cache\node-sass\4.13.1\win32-x64-79_binding.node

> [email protected] postinstall C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Testing binary
Binary is fine
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 173 packages from 137 contributors and audited 528 packages in 16.233s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

image

因此,通过演绎推理,它必须与如何请求/响应正在通过VPN处理...

我确保rm /c/Users/---/AppData/Roaming/npm-cache/node-sass/4.13.1/win32-x64-79_binding.node并在每次测试之间以新的node_modules目录开始。

我通常在办公室工作,所以我只需要处理代理,这不会造成任何问题。 但是,既然我们都在家工作,我就有机会碰到了这个问题……希望能有所帮助,,

版本和系统信息

  • Windows 10
$ node --version
v13.11.0
$ npm --version
6.13.7

所有29条评论

我认为我们有许多相同的报告,因此这些都应该是重复的。

https://github.com/npm/cli/issues/423
https://github.com/npm/cli/issues/425
https://github.com/npm/cli/issues/442
https://github.com/npm/cli/issues/451
https://github.com/npm/cli/issues/455
https://github.com/npm/cli/issues/465

Afaik通过强制清除缓存并升级/更新到最新的npm版本来解决此问题。

感谢@DanielRuf将所有这些❤️链接

489

我猜我们可以检查哪个版本首次引入了此功能(做一个小的git bisect ),并检查stacktraces的相似性。

问题中提到了以下版本:

6.4.1
6.9.0
6.10.2
6.12.1
6.13.1
6.13.4

现在尝试获得可重现的测试用例。

过去进行相关更改以记录此错误: https :

使用本地npm 6.13.1进行测试(在macOS上):

@vue/cli :不可复制
npm audit fix :不可复制
plotly.js :不可复制
expo-cli :不可复制

到目前为止,这似乎是由其他错误引起的,这些错误过早取消了CLI。

我记得我们在Ubuntu上也有此错误,它具有最新版本和一些软件包。

尝试安装公司项目进行开发时遇到相同的错误。
Microsoft Windows [版本10.0.17134.1184]

使用NVM切换节点/ npm的实例
节点v10.14.2(64位),npm v6.4.1
节点v12.4.0(64位),npm v6.9.0

使用Angular CLI版本8.3.21生成了项目

[适用于Windows的NVM设置,Ecor Ventures LLC,星期二,8月7,2018 9:46:31 PM]

(请注意,必须是nvm-windows;实际的nvm在非WSL Windows上不起作用,并且不能区分64位)

我们在本地开发和CI系统中都间歇性地收到此错误。 很高兴添加任何其他可能有用的日志记录。 附加了Mac上笔记本电脑上刚刚发生的运行中的npm日志-尝试npm安装我们的一个私有软件包。 立即重新运行命令可以正常工作。

npm install @globalworldwide/km-core@latest
2020-01-04T02_02_56_202Z-debug.log

❯npm -v
6.13.4
❯节点-v
v13.5.0

让我知道是否有什么我可以帮助您解决的,想解决这个问题。

触发的动作:

分流的想法:

  • 似乎在安装导致此cb() never called!错误的软件包时出现错误。
  • 有42个问题需要分类...
  • https://github.com/npm/cli/issues/442原始问题引用了一个修复程序,该更新引用了更新和清理缓存来解决问题(更新修复程序权限),缓存可能表明问题存在于cacachepacote
  • https://github.com/npm/cli/issues/451似乎有相同的症状,但原因似乎不在npm ,尽管它确实有助于指出安装软件包时的问题

令人震惊的是,很少有人知道如何使用搜索栏...

有谁知道这可能是什么原因吗?

有什么解决方法吗?

当我在Windows 10上本地运行npm install ,一切正常。

当我在dev.azure.com上的64位Amazon Linux / 4.13.0计算机上运行npm install时,出现以下错误:

120982 error cb() never called! 120983 error This is an error with npm itself. Please report this error at: 120984 error <https://npm.community>

我尝试将Node环境从Node 10升级到Node 12,因为我也在本地运行Node 12,但这似乎没有任何影响。

我不知道该怎么办,这个问题完全阻塞了!!

@jslegers很遗憾听到您被阻止了!

在我对该问题的初步研究中,我注意到该问题https://github.com/npm/cli/issues/442引用了我们的社区页面,该页面具有指向您可能的解决方案的链接。 清除缓存似乎可以解决某些问题。 我建议尝试一下,看看是否可以解除您的工作阻塞。

@jslegers很遗憾听到您被阻止了!

在我对该问题的初步研究中,我注意到问题#442引用了我们的社区页面,该页面具有指向您可能的解决方案的链接。 清除缓存似乎可以解决某些问题。 我建议尝试一下,看看是否可以解除您的工作阻塞。

谢谢你的提示!

我最终确实设法自己找到了解决方案。

显然,此问题是由于我对本地包结构进行了一些更改而导致的。 作为正在进行的重构尝试的一部分,我摆脱了一种千篇一律的,不受限制的包,并用一堆小范围的包代替了它。 显然,这混淆了NPM并导致了npm ERR! cb() never called!错误。

似乎已通过删除我的package-lock.json文件并将此删除推到发生此问题的远程分支来解决此问题。

对我来说,这是在我尝试通过VPN通过企业代理npm install时发生的(实际上,代理似乎无关紧要)。 NPM在程序包尝试下载二进制文件时(例如,对于我来说为https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-79_binding.node)感到窒息。安装后步骤(不知道它是否与软件包相关)。

关闭VPN(全局保护)和代理后,一切正常进行。

开启代理和VPN❌

$ npm i node-sass
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\---\AppData\Roaming\npm-cache\_logs\2020-03-16T23_37_35_801Z-debug.log

image

image

image

2020-03-16T23_37_35_801Z-debug.log

关闭代理和VPN✔

$ npm i node-sass
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

> [email protected] install C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-79_binding.node
Download complete
Binary saved to C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Caching binary to C:\Users\---\AppData\Roaming\npm-cache\node-sass\4.13.1\win32-x64-79_binding.node

> [email protected] postinstall C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Testing binary
Binary is fine
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 173 packages from 137 contributors and audited 528 packages in 16.034s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

image

仅限代理✔

$ npm i node-sass
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

> [email protected] install C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/win32-x64-79_binding.node
Download complete
Binary saved to C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Caching binary to C:\Users\---\AppData\Roaming\npm-cache\node-sass\4.13.1\win32-x64-79_binding.node

> [email protected] postinstall C:\Users\---\Desktop\foo\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\---\Desktop\foo\node_modules\node-sass\vendor\win32-x64-79\binding.node
Testing binary
Binary is fine
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 173 packages from 137 contributors and audited 528 packages in 16.233s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

image

因此,通过演绎推理,它必须与如何请求/响应正在通过VPN处理...

我确保rm /c/Users/---/AppData/Roaming/npm-cache/node-sass/4.13.1/win32-x64-79_binding.node并在每次测试之间以新的node_modules目录开始。

我通常在办公室工作,所以我只需要处理代理,这不会造成任何问题。 但是,既然我们都在家工作,我就有机会碰到了这个问题……希望能有所帮助,,

版本和系统信息

  • Windows 10
$ node --version
v13.11.0
$ npm --version
6.13.7

darcyclarke关闭了这个vor 1 Stunde

@darcyclarke是否已通过某些提交解决了此问题?

@DanielRuf表示歉意。 在ZenHub(我们的项目管理系统)中,出现了一系列问题。 我已经重新打开了。

遇到相同的问题,尝试安装空白的expo init项目。 节点13.12.0,npm 6.14.5
对我来说,将项目文件夹添加到Windows Defender排除项似乎有所帮助。
Settings->Update and Security->Windows Security->Virus & threat protection -> Virus & threat protection settings -> Exclusions并且我已经添加了整个文件夹。

这引起问题了吗? 我认为许多人没有防病毒软件或Windows10。在Linux和macOS上也发生这种情况,而没有任何实时防病毒扫描程序。

通常,我会在安装时禁用防病毒软件,以便更快地进行安装,因为它会在访问/创建时扫描每个文件-使用禁用的脚本,然后进行全面扫描,然后便可以正常工作。

可以肯定,但是我已经尝试过多次,但都出现了相同的错误,然后我做到了,这很有帮助。 可能与索引毫无头绪有关。

虽然在npm config设置了https-proxy值,但是不在具有代理的网络上,但是却出现了此错误。 如果我删除了代理服务器的值,那么事情将再次起作用。 如果有人遇到此错误,建议您检查一下npm的代理设置,这可能是一个好主意。

npm版本: 6.17.4
节点版本: 12.18.3
nvm版本: 0.35.3

其他相关问题:

1696

1671

1740

1737

1731

1666

1647

1625

1608

1605

1552

1546

1531

1505

1466

1464

1720

1748

我们有时在Windows WSL2中得到这个

  • npm版本: 6.14.8
  • 命令。 npm --unsafe-perm ci
  • 但在同一系统上,WSL2- WSL#4690中也存在一些ssh / git连接问题,因此在我们的情况下,这可能不是npm问题
此页面是否有帮助?
4 / 5 - 1 等级

相关问题

ahuglajbclajep picture ahuglajbclajep  ·  3评论

1000i100 picture 1000i100  ·  3评论

darcyclarke picture darcyclarke  ·  4评论

zypA13510 picture zypA13510  ·  4评论

darcyclarke picture darcyclarke  ·  3评论