Puneet
Puneet

Reputation: 635

Error: Could not locate the bindings file. Tried: #56

I am getting the following error when I'm starting GenieACS cwmp. I have also tried to rebuild several times.

Error: Could not locate the bindings file. Tried:
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/build/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/build/Debug/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/build/Release/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/out/Debug/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/Debug/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/out/Release/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/Release/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/build/default/xmljs.node
→ /usr/local/lib/node_modules/genieacs/node_modules/libxmljs/compiled/0.10.25/linux/x64/xmljs.node
at bindings (/usr/local/lib/node_modules/genieacs/node_modules/libxmljs/node_modules/bindings/bindings.js:88:9)
at Object. (/usr/local/lib/node_modules/genieacs/node_modules/libxmljs/lib/bindings.js:1:99)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/genieacs/node_modules/libxmljs/index.js:4:16)
at Module._compile (module.js:456:26)
18 Dec 18:34:26 - Worker 7837 died (8)

Upvotes: 23

Views: 69293

Answers (9)

Manush Shah
Manush Shah

Reputation: 1

reinstalling dependencies and then npm rebuild worked like a charm for me!

Upvotes: 0

Pradeep Yenkuwale
Pradeep Yenkuwale

Reputation: 300

This happens when npm install command fails installing some of the packages and continues to install other package, due to bad network connectivity or network disconnections during npm install.

Solution 1: Deleting node_modules and package_lock.json file and run npm install command again.

Solution 2: Just run npm rebuild, this command will just complete the installation of incomplete packages.

Upvotes: 0

Oleksandr Hrin
Oleksandr Hrin

Reputation: 886

I did all the actions from this thread and many others but without success. then I just removed my 'node_modules' folder and run "npm install" again, and it solved the issue. So you can also try this ;)

Upvotes: 8

hunter2009
hunter2009

Reputation: 153

npm rebuild may resolve the problem

Upvotes: 5

C_Sutt
C_Sutt

Reputation: 202

Solution(for me):

Deleting my yarn.lock file then running <yarn> in the terminal is what finally worked. At some point the project I'm working on had both npm & yarn package managers utilized and would fail every time I tried to run <npm install>.

Environment:

  • macOS - Catalina - 10.15.2

  • Node-Expat Version - "node-expat": "^2.3.17"

  • Sharp Version - "sharp": "^0.23.4",

  • Node Version(on local machine) - 12.12.0.

Previous Attempts(did not resolve):

  1. Removed node_modules and ran npm install.

  2. Ran node-gyp install.

  3. Ran npm install -g node-gyp.

  4. ran node-gyp rebuild -g.

  5. Removed the sharp directory from the node_modules and ran #4 above.

  6. Removed node-expat and ran npm install node-expat.

Notes and Credit:

It was a colleague of mine that finally figured this out after my attempts failed. However, I went to work on another project the next day and experienced the same error when performing an npm i. Without hesitation I skipped all the attempts I had tried in the other project, deleted my yarn.lock file, ran yarn and was back in business.

Upvotes: 1

jonyB
jonyB

Reputation: 12055

I had the same problem but with the leveldown NPM, tried the above answer and didn't work. Finally downgraded node from v11 to v8.15 and it worked

Upvotes: 0

Ben Simms
Ben Simms

Reputation: 41

I just went around the houses to resolve this issue.

I was using PM2 and had multiple node apps running on the one server, I'm not sure why, but when I killed all the apps and then did an 'npm i' in the troublesome project, it all went through fine. No sudo, no deleting node_modules and all running the latest version of node.

Hope this helps

Upvotes: 1

Tom Wolf
Tom Wolf

Reputation: 51

I had this issue before

I downgraded the dependency of libxmljs to @0.11.0 (package.json) and ran sudo npm install libxmljs

Upvotes: 5

Omar M.
Omar M.

Reputation: 341

I spoke to the developer, and he said that it was a bug in node-gyp, you should simply do the following:

npm install node-gyp

if that didn't solve the issue, then you can install libxmljs again just to be sure

npm install libxmljs

i just tried it, worked like a charm

Upvotes: 21

Related Questions