简体   繁体   中英

invalid ELF header in node.js on linux putty

I am facing the error invalid ELF header when I'm trying to run my node.js project on my printer having linux os using putty. The project was developed on windows. I'm attaching the whole error that I'm receiving. Please help.

stack=[Error: /sirius/rw/test/node-v8.11.1-linux-armv7l/node_modules/ref/build/Release/binding.node: invalid ELF header,     
at Object.Module._extensions..node (module.js:681:18),     
at Module.load (module.js:565:32),     
at tryModuleLoad (module.js:505:12),     
at Function.Module._load (module.js:497:3),     
at Module.require (module.js:596:17),     
at require (internal/module.js:11:18),     
at bindings (/sirius/rw/test/node-v8.11.1-linux-armv7l/node_modules/ref/node_modules/bindings/bindings.js:81:44),     
at Object.<anonymous> (/sirius/rw/test/node-v8.11.1-linux-armv7l/node_modules/ref/lib/ref.js:5:47),     
at Module._compile (module.js:652:30),     
at Object.Module._extensions..js (module.js:663:10)]

Because the project was developed on windows; npm needs to compile some node modules specially for the linux OS, so simply using the modules as is won't always work.

First remove the node modules:

rm -rf node_modules/

Then generate the same modules for linux using the following command:

npm update

I hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM