gpt4 book ai didi

javascript - 错误 : Module did not self-register.

转载 作者:搜寻专家 更新时间:2023-10-31 23:31:30 24 4
gpt4 key购买 nike

服务器:Ubuntu服务器14.04

Node :v4.2.6 LTS

npm: 1.3.10

我从 git remote 中拉取了我同事的工作。他将 node_modules 设为 .gitignore。所以我必须 npm 安装模块。

但是在成功安装 npm 之后。当我尝试使用 mocha 启动项目时。这让我想起了一个没有自注册的模块

错误来自于Bcrypt模块。

在绑定(bind) (/base_dir/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)

我不想将我的 Node 降级到 0.10,因为我不能在该版本中使用 JS promise。不知何故,JS promise 在我的工作中是必须的

最佳答案

发生此问题的主要原因是您从其他地方复制/克隆了存储库,但是应该在您的机器上本地安装/注册 nodeJS 的一些模块,在此期间发生构建过程(可能是某些本地语言,如 C)。

and be noted that the node_modules folder should not be staged for versioning. and should be ignored by versioning tool. and the one who is trying to clone this package should build / install firstly.

我找到了这个问题的答案。但是请不要仅仅因为你想要就投入这个。我使用

升级 NPM
npm install npm -g.

之后,删除node_modules文件夹,然后,

npm install

一切都会好的。

关于javascript - 错误 : Module did not self-register.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34964310/

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