错误:模块未自注册. [英] Error: Module did not self-register.
问题描述
服务器:Ubuntu服务器14.04
Server: Ubuntu server 14.04
节点:v4.2.6 LTS
Node: v4.2.6 LTS
npm:1.3.10
npm: 1.3.10
我从git remote整理了我的同事的作品.他将node_modules设置为.gitignore.因此,我必须npm安装模块.
I pullled my colleage's work from git remote. He made the node_modules as .gitignore. So I have to npm install the modules.
但是在成功安装npm之后.当我尝试使用摩卡启动项目时.这让我想起了一个模块没有自动注册
But after a successful install of npm. when I try to start the project using mocha. It remind me of a module didn't self-register
错误来自Bcrypt模块.
The error comes from the module of Bcrypt.
在绑定(/base_dir/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
我不想将节点降级到0.10,因为我不能在该版本中使用JS Promise.不知何故,JS许诺是我工作中必不可少的
I don't want to downgrade my node to 0.10, because, I can't use JS promise in that version. Somehow, JS promise is a must in my work
推荐答案
发生此问题的主要原因是,您从其他地方复制/克隆了存储库,但是应在您的计算机上本地安装/注册用于nodeJS的某些模块.发生在构建过程中(可能是某些本地语言,如C).
This problem happens mostly because you copied/cloned the repository from somewhere else, but some modules for nodeJS should be installed/registered locally on your machine, during which the happens the build process(maybe some native language like C).
,请注意,不应暂存 node_modules 文件夹以进行版本控制.并应由版本控制工具忽略.并且尝试克隆此软件包的用户应该首先构建/安装.
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.
我找到了这个问题的答案. 但是,plz不会仅仅因为您想要而就投入此. 我使用
I find the answer to this problem. But plz don't devoted this just because you want. I upgrade the NPM using
npm install npm -g.
然后,删除node_modules文件夹, 然后,
after that, delete the node_modules folder, then,
npm install
一切都会很好.
这篇关于错误:模块未自注册.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!