Install node-expat on ubuntu or centos - node.js

I'm trying to install node-expat. I've tried everything suggested that I could find. I don't get any build errors while running npm install node-expat. I've put in all the dependencies & building kits, tried npm cache clean & tried it on both CentOS (Amazon Linux) and Ubuntu 12.10 but the error remains the same:
module.js:485
process.dlopen(filename, module.exports);
^
Error: Module version mismatch, refusing to load.
at Object.Module._extensions..node (module.js:485:11)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/home/ubuntu/cc/node_modules/node-expat/lib/node-expat.js:4:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
How can I get it to run without hitches?
The reason I want node-expat is for node-xmpp

This may or may not help you, but I was getting the same error with an appjs app I'm working on, and I just figured out what was causing it for me. I have node v0.10.x installed on my machine, but I was building the modules to include them in an appjs app (which currently comes packaged with v0.8.x of node.exe. So I was building the module with 0.10, but trying to run it on 0.8.
I uninstalled my node 0.10, installed 0.8, rebuilt/installed the offending module into my appjs app, and the error went away. So make sure you're building the module with the same version of node you're trying to run it on!

Related

"I got an error after reinstalling nodejs"

node:internal/modules/cjs/loader:1161 return process.dlopen(module,
path.toNamespacedPath(filename));
^
Error: The module '\?\G:\Discord
bot\Bot\ZackyBot\node_modules\canvas\build\Release\canvas.node' was
compiled against a different Node.js version using NODE_MODULE_VERSION
83. This version of Node.js requires NODE_MODULE_VERSION 88. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1161:18)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14)
at Module.require (node:internal/modules/cjs/loader:991:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object. (G:\Discord bot\Bot\ZackyBot\node_modules\canvas\lib\bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1102:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14)
at Module.require (node:internal/modules/cjs/loader:991:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object. (G:\Discord bot\Bot\ZackyBot\node_modules\canvas\lib\canvas.js:9:18)
at Module._compile (node:internal/modules/cjs/loader:1102:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
at Module.load (node:internal/modules/cjs/loader:967:32) { code: 'ERR_DLOPEN_FAILED' }
It seems like you installed a newer version of NodeJS than earlier. But you did not compile your project ZackyBot's node modules using the current version of the NodeJS you installed.
I would suggest you go to your project directory and clean all your node modules. Then reinstall them again. Follow the steps below:
Delete node_modules directory inside ZackyBot directory
Execute npm install command on a terminal from ZackyBot directory
Since you updated your nodeJS version to a newer one, you need to update your canvas too.
run npm install canvas and you should be good to go.
This might be due to improper installation of node modules and can occur due to poor network conditions.
Solved this issue by deleting the nodemodules folder and doing a clean installation of node modules files by running "npm install".

Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node while webpack build

I'm getting following error while build my project. Actually error says "Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node", but i have "Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-48/binding.node". I don't know Why it is not refering "linux-x64-48"?
Error says Run npm rebuild node-sass --force, i did so but no luck. Please help me git rid of this issue.
node version: v8.9.1
npm: 5.5.1
Note: I even tried by removing entire node_modules and reinstalled(npm install) it. But still getting same error.
ERROR in ./node_modules/css-loader!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6ef6ca5e","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/components/UserProfile.vue
Module build failed: Error: Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
at module.exports (/myproject/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/myproject/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/myproject/node_modules/sass-loader/lib/loader.js:3:14)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
# ./node_modules/vue-style-loader!./node_modules/css-loader!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6ef6ca5e","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0&bustCache!./src/components/MyProfile.vue 4:14-346 13:3-17:5 14:22-354
# ./src/components/UserProfile.vue
# ./src/router.js
# ./src/main.js
# multi ./build/dev-client ./src/main.js
ERROR in ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/assets/scss/main.scss
Module build failed: Error: Missing binding /myproject/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 6.x
This issue is been resolved by npm rebuild node-sass, github issue
This usually happens when the environment changes rapidly (copying sass file to one location to another)
This will help you to solve this issue.
npm install
npm rebuild node-sass --force
This could be due to the node version mismatch on your machine and your application is expecting.
In my case while building a docker image the version on base machine and on docker image were different.

How to install: caress server node server.js . Error: 'Cannot find module '....buffertools.node'

I am installing the the library found from MIT students using TUIO. According to their instructions I was supposed to start the server but I got an error.
Does anyone know how to fix this error?
C:\Users\PC\Desktop\server1.1>node examples/server.js
info - socket.io started
module.js:442
throw err;
^
Error: Cannot find module './build/Debug/buffertools.node'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\PC\Desktop\server1.1\node_modules\buffertool
s\buffertools.js:26:20)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
I tried following there steps and got my server stared.
I think you are missing npm i after cloning repo.
please do npm i and try starting server
You need to install the dependency packages before you can run your project.
npm install looks for the packages listed in the package.json file and installs them with their dependencies recursively.
If you are getting specific error in installation of particular package, it could be internet issue/os issue and most probably node and npm version issue. Make sure you are using a stable version of node, its version no should be even.

Unknown error running phantomjs in Ubuntu 14.04

While running phantomjs module in nodejs, I got this strange error
phantom stderr: Fontconfig warning: ignoring UTF-8: not a valid region tag
/var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:83
throw e
^
Error: /var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/build/Release/weakref.node: invalid ELF header
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 bindings (/var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/lib/weak.js:7:35)
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)
Can anyone tell me how to solve it? It always causes the nodejs app to crash. I tried rebuilding the phantomjs node module, reinstalling the latest phantomjs like this one, and still the error showed up. I tried building the phantomjs source, but apparently my machine didn't have enough virtual memory. :(
It turns out that ubuntu download different files when I run npm install. So in my computer (OSX) it runs fine while on ubuntu, it crashes. To resolve it, I run npm remove then npm install again.

Nodejs Module version mismatch. Expected 11, got 1

after updating NodeJS to v0.10.29 I got the following error:
Error: Module version mismatch. Expected 11, got 1.
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 bindings (/home/masiar/usi_liquid_streams/node_modules/jsdom/node_modules/contextify/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/home/masiar/usi_liquid_streams/node_modules/jsdom/node_modules/contextify/lib/contextify.js:1:96)
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)
Executing sudo npm update did not work. I installed back version v0.10.15 (was using that one before), ran sudo npm update and uninstalled and installed back jsdom gave the same error.
This problem is usually happened when upgrading node version. You are in this scenario: you are using Node for example version 5. You add some libraries inside your project, build and run that. All your libraries will be compiled under node version 5.
And then you upgrade your node for example to version 6. And then you run some commands that using node, for example npm run test. The problem is here: you use newer node version for running libraries that compiled by older node.
Solving this is easy by 2 following commands:
rm -rf node_modules // force remove node_modules directory
npm install // install again all libraries. Libraries will be compiled again with new node version
Hope this help :)

Resources