且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

npm ERR! cb()从未调用过!尝试运行npm install命令时出现错误

更新时间:2021-06-30 22:50:57

在我的情况下,我在package.json中有一个自己的自定义node_module,如下所示:

In my case, I had an own custom node_module which is in my package.json like that:

// ...
"dependencies": {
    // ...
    "my-module": "file:../../my-module",
},
// ...

此软件包仅在特定的环境中可用(通过npm install ../../my-module动态添加到package.json中),这是有意为之的, 但是我忘记了它,并且在其他环境(模块不可用可用)中运行npm install时忘记了 发生了mysteriuos cb() never called错误.

This package is only available in a specific environment (dynamically added to package.json via npm install ../../my-module), which is by intend, but I forgot about it and when I ran npm install in another environment (where my module was not available) the mysteriuos cb() never called error occured.

在将选项--no-package-lock放在npm install后面之后,错误变得更加明显,告诉我它与my-module有关.

After putting the option --no-package-lock behind the npm install the error got more clear, telling me that it has something to do with my-module.

另请参阅: https://***.com/a/52474959/3063191

希望这会有所帮助:)