Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Module did not self-register.

Server: Ubuntu server 14.04

Node: v4.2.6 LTS

npm: 1.3.10

I pullled my colleage's work from git remote. He made the node_modules as .gitignore. So I have to npm install the modules.

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

The error comes from the module of Bcrypt.

at bindings (/base_dir/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)

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

like image 201
cinqS Avatar asked Jan 23 '16 13:01

cinqS


1 Answers

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).

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.

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.

after that, delete the node_modules folder, then,

npm install

Everything will be good.

like image 182
cinqS Avatar answered Nov 11 '22 11:11

cinqS