Error module version mismatch

Platform: Linux When running my node.js program I got the following error Error: Module version mismatch. Expected 11, got 1.
Platform: Linux

When running my node.js program I got the following error

Error: Module version mismatch. Expected 11, got 1.

asked Mar 23, 2013 at 7:45

Alfred's user avatar

2

you might give the error like this:

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 Object.<anonymous> (/home/user/node_modules/xml2json/node_modules/node-expat/lib/node-expat.js:4:13)
    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)

and then, you can notice the error in module or somewhere.

this is because you have updated your node, you might rebuild the module found above.

i revole my question by reinstall(remove, then install) xml2json.

good luck!

answered Mar 25, 2013 at 7:35

hisland's user avatar

hislandhisland

6697 silver badges8 bronze badges

2

answered Oct 14, 2014 at 22:26

menzoic's user avatar

menzoicmenzoic

8741 gold badge8 silver badges10 bronze badges

Platform: Linux

For future reference in node.js v0.10.x(at least v0.10.0) I got this error:

Error: Module version mismatch. Expected 11, got 1.

To fix this I found this interesting link and also had some help from Ben Noordhuis. The following command helped me get rid of this error:

npm update

answered Mar 23, 2013 at 7:45

Alfred's user avatar

AlfredAlfred

60.3k32 gold badges144 silver badges184 bronze badges

0

This usually happens when you install a package using one version of Node, then change to a different version. This can happen when you update Node, or switch to a different version with nvm.

It can also happen if you’re trying to run a process as root with a globally installed Node, but you’re running an nvm-managed node within your own user account.

To fix this, you can simply re-install the packages using the correct version of Node. Also ensure that you’re using the same version of Node across the different users.

answered Apr 29, 2013 at 21:51

robbrit's user avatar

robbritrobbrit

17.4k4 gold badges50 silver badges67 bronze badges

This problem is happened because following 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. 

answered Oct 17, 2016 at 19:41

hqt's user avatar

hqthqt

29.2k51 gold badges171 silver badges247 bronze badges

One more thing to try if you’re using nvm- make sure you are running the same version of node globally as well as within the app.

:/$ node -v
v6.0.0

:/var/www/app$ node -v
v6.2.0

If they aren’t in agreement:

:/$ nvm use 6.2.0
Now using node v6.2.0 (npm v3.8.9)

(This is what worked for me.)

answered Jun 11, 2016 at 1:15

jamesthe500's user avatar

jamesthe500jamesthe500

3411 gold badge7 silver badges9 bronze badges

0

You can find a list of node module versions and their corresponding node release on this page https://nodejs.org/en/download/releases/

NODE_MODULE_VERSION refers to the ABI (application binary interface) version number of Node.js, used to determine which versions of Node.js compiled C++ add-on binaries can be loaded in to without needing to be re-compiled. It used to be stored as hex value in earlier versions, but is now represented as an integer.

answered Feb 10, 2016 at 10:42

Thomas Welton's user avatar

Sometimes the problem arises due to the nodejs version too.

Try updating the npm and nodejs version.
Follow this link to update your nodejs.

And to update your npm use:

sudo npm install npm -g

Hope this helps!

answered Oct 13, 2017 at 8:04

techie95's user avatar

techie95techie95

5053 silver badges16 bronze badges

In my case the reason for the error was a C++-AddOn which was compiled against a different node.js Version.

So you might have to recompile your C++-AddOn, so the major versions of the addon and the node.js you run match.

answered Aug 2, 2016 at 13:47

A.Franzen's user avatar

A.FranzenA.Franzen

7254 silver badges10 bronze badges

1

I had this problem with systemd, but I could run the app using node myapp.js.

It turns out that the path in ExecStart differed from the one I got from which node. Changing that in the service file fixed it for me.

source

answered Jul 30, 2017 at 9:30

ki9's user avatar

ki9ki9

5,0095 gold badges36 silver badges48 bronze badges

None of the answers worked for me, so here is my solution.

Error: Module version mismatch. Expected 48, got 51.
at Error (native)
at Object.Module._extensions..node (module.js:597:18)

The 48 and 51 correspond to node versions as found on nodejs release page:
https://nodejs.org/en/download/releases/

So I installed nvm, a node version manager, and switched my node version to 48 (6.11.x) and then ran
rm -rf node_modules/
and
npm install

My particular module, mcrypt, depended on c++ binaries, and the Node Module Version has a direct impact:

NODE_MODULE_VERSION refers to the ABI (application binary interface) version number of Node.js, used to determine which versions of Node.js compiled C++ add-on binaries can be loaded in to without needing to be re-compiled. It used to be stored as hex value in earlier versions, but is now represented as an integer.

answered Oct 17, 2017 at 20:26

WillW's user avatar

WillWWillW

436 bronze badges

The easiest way to get to where you need to be, after you’ve changed your node version is:


rm -Rf node_modules/ && yarn && yarn start

Replace yarn start with whatever the command is that you need to start your server.

answered Jan 5, 2018 at 20:19

Rambatino's user avatar

RambatinoRambatino

4,5661 gold badge33 silver badges56 bronze badges

If the module is a c++ add-on, you may have to rebuild the node-gyp

node-gyp rebuild

answered May 19, 2018 at 15:16

kanagaraj palanisamy's user avatar

None of the above answers solved the issue for me. The solution for me was to use xml2js instead of xml2json.

answered Dec 11, 2018 at 12:49

rycornell's user avatar

rycornellrycornell

7096 silver badges13 bronze badges

This error normally comes when you run npn install inside the module folder on another node version you are using now to run the script. Try running npm install again in the module directory.

Am 02.08.2016 um 13:06 schrieb JMishou notifications@github.com:

App threw an error during load
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/wiring-pi/lib/exports.js:1:97)
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/wiring-pi/lib/exports.js:1:97)

Unless I am reading this wrong this is expecting a Node module version that is not released yet?

The current module release is 48 https://nodejs.org/en/download/releases/ https://nodejs.org/en/download/releases/
I have tried node version v6.3.0, 6.3.1, and 5.12.0.

I have followed all of your suggestions here even though that a downgrade to a previous version and not an upgrade to an unreleased version.. #2 #2
I have tried reinstalling electron, rebuilding it, removing the module folder and re cloning it. I’m at a loss.

The only other instance of this I could find is here don/node-eddystone-beacon#40 don/node-eddystone-beacon#40 Electron-rebuild seemed to work in their case. Not so much for me.

Got any suggestions? Much appreciated.

-Jason.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #9, or mute the thread https://github.com/notifications/unsubscribe-auth/AA8mOou6_FKonvdGI1i8lQf-38E-dwdvks5qbyTCgaJpZM4Jafsm.

Содержание

  1. Error: Module version mismatch. Expected 48, got 57. #166
  2. Comments
  3. Error: Module version mismatch. Expected 49, got 48. #9
  4. Comments
  5. Error: Module version mismatch. Expected 46, got 14. #183
  6. Comments
  7. Footer
  8. OS X: Error: Module version mismatch. Expected 48, got 49 #683
  9. Comments
  10. «Module version mismatch» error #58
  11. Comments

Error: Module version mismatch. Expected 48, got 57. #166

Running ijsnotebook after ijsinstall . But got this error:

While running ipython notebook succeed.

The text was updated successfully, but these errors were encountered:

That error message often happens when the node version in a machine has been updated. In your case, it looks like you’ve installed IJavascript using Node v6, and now you’re trying to run it using Node v8. If this is the case, uninstalling IJavascript and installing it again should fix the problem.

Thanks for you answer. But issue still exits.

Here is my local node versions:

And run nvm use system still throw this error.

And run nvm use system still throw this error.

Without seeing the commands you run and their output I can’t help much.

Having said that, since your environment uses multiple multiple node versions, I’d suggest you install IJavascript’s kernelspec using full paths; like this:

I also encounter this issue even if I tried uninstall and install with ijsinstall —spec-path=full .

@shunmian I’ll try to help, but please, could you post the commands you’re running and their output?

@n-riesco , thanks for your time! The command I run is

, which is exactly the one documented in the README.MD for macOS.

@shunmian Those are the instructions for a fresh install. The error reported in this issue only happens when node.js has been updated after running ijsinstall ; for example, like this:

  • install Node v6
  • npm install -g ijavascript
  • ijsinstall
  • update to Node v8
  • error: Error: Module version mismatch. Expected 48, got 57.

I’m sorry but I don’t have enough information to help you.

I tried reinstalling and installing zeromq, ijavascript, rebuilding, using ijsinstall —spec-path=full , I updated node and tried again — nothing works. I still get:

node -v v11.9.0
npm -v 6.5.0
macOS 10.13.6
I’m using anaconda, latest version, installed today.

What should I try to do with this, @n-riesco ?

@panpiotrs, the log message is telling us that you’re running node v11 , but IJavaScript was installed using node v5 .

Without knowing the details, I’m guessing you’ve used sudo npm install -g ijavascript to install IJavaScript. Do you really need to use sudo ? If so, what do you get when you run sudo npm —versions ?

I didn’t use sudo . After sudo npm —versions I see the same versions of npm and node → 6.5.0 and 11.9.0, and some other packages, v8, openssl, etc, nothing related to the problem.
I’m upgrading node with current (never lts) package from https://nodejs.org/ . Before today I had v9, I have no idea where this v5 is coming from.

@panpiotrs The log message shows IJavascript is installed under /usr/local/lib/node_modules/ . Doesn’t that require admin rights in macOS?

I’d try and get rid of /usr/local/lib/node_modules/ijavascript :

  • either, rename it: sudo mv /usr/local/lib/node_modules/ijavascript /usr/local/lib/node_modules/ijavascript.old
  • or delete it: sudo rm -rf /usr/local/lib/node_modules/ijavascript

And just to be sure, I’d install IJavascript again: npm install -g ijavascript

If zeromq is rebuilt, you should see the following lines:

Источник

Error: Module version mismatch. Expected 49, got 48. #9

App threw an error during load
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/wiring-pi/lib/exports.js:1:97)
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/wiring-pi/lib/exports.js:1:97)

Unless I am reading this wrong this is expecting a Node module version that is not released yet?

I have tried node version v6.3.0, 6.3.1, and 5.12.0.

I have followed all of your suggestions here even though that a downgrade to a previous version and not an upgrade to an unreleased version.. #2

I have tried reinstalling electron, rebuilding it, removing the module folder and re cloning it. I’m at a loss.

The only other instance of this I could find is here don/node-eddystone-beacon#40 Electron-rebuild seemed to work in their case. Not so much for me.

Got any suggestions? Much appreciated.

The text was updated successfully, but these errors were encountered:

This error normally comes when you run npn install inside the module folder on another node version you are using now to run the script. Try running npm install again in the module directory.

App threw an error during load
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/wiring-pi/lib/exports.js:1:97)
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) as dlopen
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) as .node
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/wiring-pi/lib/exports.js:1:97)

Unless I am reading this wrong this is expecting a Node module version that is not released yet?

I have followed all of your suggestions here even though that a downgrade to a previous version and not an upgrade to an unreleased version.. #2 #2
I have tried reinstalling electron, rebuilding it, removing the module folder and re cloning it. I’m at a loss.

The only other instance of this I could find is here don/node-eddystone-beacon#40 don/node-eddystone-beacon#40 Electron-rebuild seemed to work in their case. Not so much for me.

Источник

Error: Module version mismatch. Expected 46, got 14. #183

It seems that Aglio is not compatible with the latest node.js due its dependency lib protagonist and drafter are not compatible with the latest version of node.

Got this after upgrading node.js to 4.2.1

The text was updated successfully, but these errors were encountered:

@ye we are working on pushing a new release shortly that will support 3.x and 4.x. The fix (upgrading the nan library) is already complete, it is just waiting on a release.

@danielgtaylor thanks for the update!

Protagonist has pushed 1.1.1 which compiles on node 4. What’s the ETA for the next aglio release?

@artlogic I’m working on it today, just had to get Protagonist 1.1.1 out first to fix a bug! 😄

@danielgtaylor thanks for the update!

@ye, @artlogic version 2.2.0 is now released which supports Node.js 3.x and 4.x. Please note, it works with the new Protagonist, which itself is based on the new Drafter that does not yet generate JSON Schema from MSON and may contain some other MSON-related bugs. We are hard at work fixing them in upcoming backward-compatible releases!

@danielgtaylor thanks for all your hard work on this!

@danielgtaylor one more thing — where would I be able to find information about the timeline for supporting MSON in protagonist? Is there a list of blocking issues?

@danielgtaylor thank you! All works now.

@danielgtaylor one more thing — where would I be able to find information about the timeline for supporting MSON in protagonist? Is there a list of blocking issues

@artlogic Protagonist is a wrapper around the Drafter C++ library so you can look into there for a list of known issues.

We have a 2.0.0 milestone which shows all of the known issues we are working though. After that our intention is to work on JSON Schema support inside Drafter.

As for a timeline, we unfortunately don’t have any dates we can share at the moment. But these are the things we are working on.

@kylef thanks for taking the time to give a status update. I appreciate it.

Looks like node has just been updated to 5.0.0 yesterday. And yes, aglio is broken on the new version again. Sigh.

@ye I’ve been using Node.js 5.0.0 since yesterday with Aglio and it is working fine for me. I just had to reinstall Aglio because of the compiled dependencies (same issue everytime you switch major versions). What specifically is the problem you are seeing?

@danielgtaylor you are absolutely correct that unistall / reinstall worked! Thank you!

Using Node.js 5.0.0, uninstall/reinstall did not work for me. Still getting:
module.js:450
return process.dlopen(module, path._makeLong(filename));

@coderdave make sure you are uninstalling/installing in the right location (e.g. with -g for a global install) and make sure that npm and node are from the same install (e.g. mine are both in /usr/local/bin/. ). After that, let me know if it’s still an issue. Worst case you should be able to do a local install (without -g ) and run with ./node_modules/.bin/aglio to confirm it can work.

Reinstalling it globally seemed to work. Thanks.

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

OS X: Error: Module version mismatch. Expected 48, got 49 #683

  • ^5.30.0:
  • 1.3.3:

When trying to build for OS X getting the following error:
tsc && node-gyp rebuild && build —mac

Error: Module version mismatch. Expected 48, got 49.
at Error (native)
at Object.Module._extensions..node (module.js:583:18)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/Users/Jenia/Desktop/git/electron-angular2-native/node_modules/macos-alias/lib/create.js:7:13)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/Users/Jenia/Desktop/git/electron-angular2-native/node_modules/macos-alias/index.js:1:18)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/Users/Jenia/Desktop/git/electron-angular2-native/node_modules/ds-store/index.js:2:13)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
From previous event:
at tsAwaiter (/Users/Jenia/Desktop/git/electron-angular2-native/node_modules/electron-builder/src/util/awaiter.ts:10:47)
at Object.build (/Users/Jenia/Desktop/git/electron-angular2-native/node_modules/electron-builder/src/builder.ts:195:52)
at Object. (/Users/Jenia/Desktop/git/electron-angular2-native/node_modules/electron-builder/src/build-cli.ts:27:28)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

  • Pull this repository: https://github.com/meltedspark/electron-angular2-native
  • Run npm install
  • Run npm run dist:osx

The text was updated successfully, but these errors were encountered:

Источник

«Module version mismatch» error #58

This is in the console, and it’s not starting the server because of it. Hopefully there’s enough info in the screenshot for versions — but please let me know if you need more.

The text was updated successfully, but these errors were encountered:

Seems you try to load native module bcrypt. Did you compiled the binaries against the current ironNode runtime version of node?

My help docs are a mess so here ‘s a link.

  • iron-node —compile compile new binaries (not destructive) into a seperate subfolder.
  • https://github.com/s-a/iron-node/blob/master/.iron-node.js#L8 native+ extends require to search native modules respecting the current v8 engine version. (compiled in the step before)

Sorry, need to check at the weekend!

On Fri, 9 Oct 2015 10:44 Stephan Ahlf notifications@github.com wrote:


Reply to this email directly or view it on GitHub
#58 (comment).

Hey, I tried today. Same problem. Here’s what I ran:

And I get the same error as above. I also tried with iron-node —compile but it just hung, so I figured it needed some pointing.

Hmm, do you have iron-node installed with npm? Or another package manager?
These Version DLL hell makes me crazy. I found this. Maybe it helps.
kelektiv/node.bcrypt.js#347 Other wise would be
cool if you could publish a reproducable sample. I d like to check this out
this weekend.

Did the compile process finished successfuly?
Am 12.10.2015 17:48 schrieb «Remy Sharp» notifications@github.com:

Hey, I tried today. Same problem. Here’s what I ran:

$ iron-node —compile=.
$ iron-node .

And I get the same error as above. I also tried with iron-node —compile
but it just hung, so I figured it needed some pointing.


Reply to this email directly or view it on GitHub
#58 (comment).

Seems like a npm update could fix it?

It was via npm (the version that comes with 4.1.0). Compilation did finish.

Just tried to reproduce but I fail in a step before on Windows32 with npm install bcrypt. 😞 I will retry frequently

@remy check this #60 (comment) out. I believe this can help you.

This works since iron-node 2.0.0

npm install bcrypt
iron-node —compile

In 2.0.2 I am getting this: Error: Module version mismatch. Expected 47, got 46.

node_modules/electron-prebuilt/dist/libgcrypt.so.11
Is this the suspect?
Why do you need it, in the first place?

I am not the creator of electron prebuilt, but have you recompiled binaries with electron —compile?

@s-a I’m having the same issue as @gritzko in 2.0.2.

In my case the only native module that I’m using is lwip. I’ve compiled lwip successfully using npm install with Node v4.2.2 and v5.1.1 (which I think the latest prebuilt version of Electron is using), so I don’t think it has any compatibility issues with Electron’s Node runtime.

I’ve tried iron-node —compile in multiple ways with no luck:

I also tried adding the .iron-node.js local config file with native+: true , but that didn’t seem to make any difference.

I always get this error:

Going forward, I’m really excited to see what happens with the external-node branch you just created. Since everyone is using a different version of Node, you might be able to prevent native module issues if iron-node was using the same version as the local version installed on the user’s machine.

Источник

Platform: Linux

При запуске моей программы node.js я получил следующую ошибку

Error: Module version mismatch. Expected 11, got 1.

14 ответы

вы можете дать ошибку следующим образом:

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 Object.<anonymous> (/home/user/node_modules/xml2json/node_modules/node-expat/lib/node-expat.js:4:13)
    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)

и тогда вы можете заметить ошибку в модуле или где-то еще.

это потому, что вы обновили свой узел, вы можете перестроить модуль, найденный выше.

я пересматриваю свой вопрос Установите(удалить, затем установить) xml2json.

удачи!

ответ дан 25 мар ’13, в 07:03

ответ дан 14 окт ’14, 23:10

Platform: Linux

Для дальнейшего использования в node.js v0.10.x(по крайней мере, v0.10.0) Я получил эту ошибку:

Error: Module version mismatch. Expected 11, got 1.

Чтобы исправить это, я нашел это интересная ссылка а также получил некоторую помощь от Бен Нордхейс. Следующая команда помогла мне избавиться от этой ошибки:

npm update

ответ дан 23 мар ’13, в 07:03

Обычно это происходит, когда вы устанавливаете пакет, используя одну версию Node, а затем переходите на другую версию. Это может произойти, когда вы обновляете Node или переключаетесь на другую версию с помощью nvm.

Это также может произойти, если вы пытаетесь запустить процесс от имени пользователя root с глобально установленным узлом, но запускаете узел, управляемый nvm, в своей собственной учетной записи пользователя.

Чтобы исправить это, вы можете просто переустановить пакеты, используя правильную версию Node. Также убедитесь, что вы используете одну и ту же версию Node для разных пользователей.

ответ дан 29 апр.

Эта проблема возникает из-за следующего сценария: вы используете Node, например, версии 5. Вы добавляете некоторые библиотеки в свой проект, собираете и запускаете его. Все ваши библиотеки будут скомпилированы под Node версии 5.

А затем вы обновляете свой узел, например, до версии 6. Затем вы запускаете некоторые команды, которые используют узел, например npm run test. Проблема здесь: вы используете более новую версию узла для запуска библиотек, скомпилированных более старым узлом.

Решить это легко с помощью двух следующих команд:

rm -rf node_modules // force remove node_modules directory
npm install         // install again all libraries. 

ответ дан 17 окт ’16, 20:10

Еще одна вещь, которую стоит попробовать, если вы используете nvm — убедитесь, что вы используете одну и ту же версию узла глобально, а также в приложении.

:/$ node -v
v6.0.0

:/var/www/app$ node -v
v6.2.0

Если они не согласны:

:/$ nvm use 6.2.0
Now using node v6.2.0 (npm v3.8.9)

(Это то, что сработало для меня.)

Создан 11 июн.

Вы можете найти список версий модуля узла и соответствующий выпуск узла на этой странице. https://nodejs.org/en/download/releases/

NODE_MODULE_VERSION относится к номеру версии ABI (бинарного интерфейса приложения) Node.js, который используется для определения того, в какие версии скомпилированных двоичных файлов надстроек C++ Node.js можно загружать без необходимости повторной компиляции. В более ранних версиях он хранился как шестнадцатеричное значение, но теперь представлен как целое число.

Создан 10 фев.

Иногда проблема возникает и из-за версии nodejs.

Попробуйте обновить версию npm и nodejs. Следовать этому ссылке чтобы обновить ваши nodejs.

И для обновления вашего npm используйте:

sudo npm install npm -g

Надеюсь это поможет!

ответ дан 13 окт ’17, 09:10

В моем случае причиной ошибки был C++-AddOn, который был скомпилирован для другой версии node.js.

Поэтому вам, возможно, придется перекомпилировать ваш C++-AddOn, чтобы основные версии аддона и node.js, которые вы запускаете, совпадали.

ответ дан 02 авг.

У меня была эта проблема с systemd, но я мог запустить приложение, используя node myapp.js.

Оказывается, путь в ExecStart отличается от того, что я получил от which node. Изменение этого в сервисном файле исправило это для меня.

источник

Создан 30 июля ’17, 10:07

Ни один из ответов не сработал для меня, так что вот мое решение.

Error: Module version mismatch. Expected 48, got 51.
at Error (native)
at Object.Module._extensions..node (module.js:597:18)

48 и 51 соответствуют версиям узлов, которые можно найти на странице выпуска nodejs:
https://nodejs.org/en/download/releases/

Поэтому я установил nvm, диспетчер версий узлов, и переключил версию узла на 48 (6.11.x), а затем запустил
rm -rf node_modules/
и
npm install

Мой конкретный модуль, mcrypt, зависел от двоичных файлов С++, и версия модуля узла имеет прямое влияние:

NODE_MODULE_VERSION относится к номеру версии ABI (бинарного интерфейса приложения) Node.js, который используется для определения того, в какие версии скомпилированных двоичных файлов надстроек C++ Node.js можно загружать без необходимости повторной компиляции. В более ранних версиях он хранился как шестнадцатеричное значение, но теперь представлен как целое число.

ответ дан 18 окт ’17, 16:10

Самый простой способ добраться туда, где вам нужно, после того, как вы изменили версию своего узла:


rm -Rf node_modules/ && yarn && yarn start

Замените yarn start какой бы ни была команда, вам нужно запустить сервер.

Создан 05 янв.

Если модуль является надстройкой C++, возможно, вам придется пересобрать узел node-gyp.

node-gyp rebuild

ответ дан 19 мая ’18, 16:05

Ни один из приведенных выше ответов не решил проблему для меня. Решение для меня состояло в том, чтобы использовать xml2js вместо xml2json.

ответ дан 11 дек ’18, 12:12

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

node.js

or задайте свой вопрос.

Platform: Linux

При запуске моей программы node.js я получил следующую ошибку:

Error: Module version mismatch. Expected 11, got 1.

4b9b3361

Ответ 1

вы можете указать ошибку:

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 Object.<anonymous> (/home/user/node_modules/xml2json/node_modules/node-expat/lib/node-expat.js:4:13)
    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)

а затем вы можете заметить ошибку в модуле или где-нибудь.

это потому, что вы обновили свой node, вы можете перестроить модуль, найденный выше.

i revole my question переустановить (удалить, затем установить) xml2json.

Удачи!

Ответ 2

npm rebuild также выполнит трюк

https://www.npmjs.org/doc/cli/npm-rebuild.html

Ответ 3

Platform: Linux

Для справок в будущем node.js v0.10.x (по крайней мере, v0.10.0) я получил эту ошибку:

Error: Module version mismatch. Expected 11, got 1.

Чтобы исправить это, я нашел эту интересную ссылку, а также получил некоторую помощь Бен Noordhuis. Следующая команда помогла мне избавиться от этой ошибки:

npm update

Ответ 4

Обычно это происходит, когда вы устанавливаете пакет с использованием одной версии Node, а затем меняете на другую версию. Это может произойти при обновлении Node или переключении на другую версию с помощью nvm.

Это также может произойти, если вы пытаетесь запустить процесс с правами root с установленным на глобальном уровне Node, но вы используете управляемый nvm node в своей учетной записи пользователя.

Чтобы исправить это, вы можете просто переустановить пакеты, используя правильную версию Node. Также убедитесь, что вы используете одну и ту же версию node для разных пользователей.

Ответ 5

Эта проблема возникает из-за следующего сценария: вы используете Node, например, версию 5. Вы добавляете в свой проект несколько библиотек, создаете и запускаете их. Все ваши библиотеки будут скомпилированы в Node версии 5.

И затем вы обновите свой Node, например, до версии 6. И затем вы запустите несколько команд, которые используют node, например npm run test. Проблема здесь: вы используете более новую версию Node для запуска библиотек, скомпилированных более старыми node.

Решение этой задачи выполняется двумя следующими командами:

rm -rf node_modules // force remove node_modules directory
npm install         // install again all libraries. 

Ответ 6

Еще одна вещь, которую нужно попробовать, если вы используете nvm — убедитесь, что вы используете ту же версию node как в глобальном, так и в приложении.

:/$ node -v
v6.0.0

:/var/www/app$ node -v
v6.2.0

Если они не согласны:

:/$ nvm use 6.2.0
Now using node v6.2.0 (npm v3.8.9)

(Это то, что сработало для меня.)

Ответ 7

Вы можете найти список версий модулей node и их соответствующую версию node на этой странице https://nodejs.org/en/download/releases/

NODE_MODULE_VERSION ссылается на номер версии ABI (прикладной двоичный интерфейс) Node.js, используемый для определения того, какие версии Node.js скомпилированных исполняемых бинарных файлов С++ могут быть загружены без необходимости повторного использования, скомпилирован. Раньше оно хранилось как шестнадцатеричное значение в более ранних версиях, но теперь оно представлено как целое число.

Ответ 8

Иногда проблема возникает из-за версии nodejs.

Попробуйте обновить версию npm и nodejs.
Следуйте этой ссылке, чтобы обновить ваши узлы.

И обновить использование npm:

sudo npm install npm -g

Надеюсь, это поможет!

Ответ 9

В моем случае причиной ошибки был С++ — AddOn, который был скомпилирован с другой версией node.js.

Так что вам, возможно, придется перекомпилировать свой С++-AddOn, поэтому основные версии аддона и node.js будут выполняться.

Ответ 10

У меня была эта проблема с systemd, но я мог запустить приложение, используя node myapp.js.

Оказывается, что путь в ExecStart отличался от пути, который я получил от which node. Изменение этого в файле службы исправило это для меня.

источник

Ответ 11

Ни один из ответов не работал у меня, так что вот мое решение.

Error: Module version mismatch. Expected 48, got 51.
at Error (native)
at Object.Module._extensions..node (module.js:597:18)

48 и 51 соответствуют версиям node, найденным на странице выпуска nodejs:
https://nodejs.org/en/download/releases/

Итак, я установил nvm, диспетчер версий node и переключил мою версию node на 48 (6.11.x), а затем запустил
rm -rf node_modules/
а также
npm install

Мой конкретный модуль, mcrypt, зависит от двоичных файлов С++, а версия модуля node имеет прямое влияние:

NODE_MODULE_VERSION ссылается на номер версии ABI (прикладной двоичный интерфейс) Node.js, используемый для определения того, какие версии Node.js скомпилированных исполняемых бинарных файлов С++ могут быть загружены без необходимости повторного использования, скомпилирован. Раньше оно хранилось как шестнадцатеричное значение в более ранних версиях, но теперь оно представлено как целое число.

Ответ 12

Самый простой способ попасть туда, где вам нужно, после того, как вы изменили версию своего узла, это:

rm -Rf node_modules/&& yarn && yarn start

Замените yarn start любой командой, которая необходима для запуска сервера.

Ответ 13

Если модуль является надстройкой c++, вам, возможно, придется пересобрать node-gyp

node-gyp rebuild

Ответ 14

Ни один из приведенных выше ответов не решил проблему для меня. Решением для меня было использование xml2js вместо xml2json.

Recommend Projects

  • React photo

    React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

Понравилась статья? Поделить с друзьями:
  • Error module vboxdrv not found
  • Error module rewrite does not exist
  • Error module php8 does not exist
  • Error module php7 does not exist
  • Error module php5 does not exist