Error: Module did not self-register.
Error: Module did not self-register.
服务器:Ubuntu 服务器 14.04
节点:v4.2.6 LTS
npm: 1.3.10
我从 git 远程拉取了我同事的工作。他将 node_modules 设为 .git 忽略。所以我必须 npm 安装模块。
但是在成功安装 npm 之后。当我尝试使用 mocha 启动项目时。这让我想起了一个没有自注册的模块
Bcrypt模块错误
at 绑定 (/base_dir/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
我不想将我的节点降级到 0.10,因为我不能在该版本中使用 JS promise。不知何故,JS promise 是我工作中必不可少的
这个问题的发生主要是因为你 copied/cloned 来自其他地方的存储库,但是 nodeJS 的一些模块应该 installed/registered 在你的机器上本地,在此期间发生构建过程(可能是一些本地的像 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
一切都会好的。
我在设置 Cypress 项目时遇到了这个问题。
在尝试删除然后重新安装所有节点模块并升级所有内容后,我发现问题是因为赛普拉斯默认使用其捆绑版本中的节点(在我的例子中是 8.0 版),而包我想使用要求节点版本为 10 或更高。
我确实在我的机器上安装了节点 12.0,但由于 cypress 没有使用它,我不得不在设置文件 (cypress.json) 中添加下面显示的行来设置 'nodeVersion' 的值到 'system',这样你就可以明确地告诉 cypress 使用你机器上安装的节点版本。
将此行添加到您的设置文件中:
**"nodeVersion": "system"**
服务器:Ubuntu 服务器 14.04
节点:v4.2.6 LTS
npm: 1.3.10
我从 git 远程拉取了我同事的工作。他将 node_modules 设为 .git 忽略。所以我必须 npm 安装模块。
但是在成功安装 npm 之后。当我尝试使用 mocha 启动项目时。这让我想起了一个没有自注册的模块
Bcrypt模块错误
at 绑定 (/base_dir/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
我不想将我的节点降级到 0.10,因为我不能在该版本中使用 JS promise。不知何故,JS promise 是我工作中必不可少的
这个问题的发生主要是因为你 copied/cloned 来自其他地方的存储库,但是 nodeJS 的一些模块应该 installed/registered 在你的机器上本地,在此期间发生构建过程(可能是一些本地的像 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.
我找到了这个问题的答案。 但是请不要仅仅因为你想要就投入这个。 我使用
升级 NPMnpm install npm -g.
之后,删除node_modules文件夹, 那么,
npm install
一切都会好的。
我在设置 Cypress 项目时遇到了这个问题。
在尝试删除然后重新安装所有节点模块并升级所有内容后,我发现问题是因为赛普拉斯默认使用其捆绑版本中的节点(在我的例子中是 8.0 版),而包我想使用要求节点版本为 10 或更高。
我确实在我的机器上安装了节点 12.0,但由于 cypress 没有使用它,我不得不在设置文件 (cypress.json) 中添加下面显示的行来设置 'nodeVersion' 的值到 'system',这样你就可以明确地告诉 cypress 使用你机器上安装的节点版本。
将此行添加到您的设置文件中:
**"nodeVersion": "system"**