Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module version mismatch. Expected 48, got 47. #453

Closed
robwilkerson opened this issue May 31, 2016 · 11 comments
Closed

Module version mismatch. Expected 48, got 47. #453

robwilkerson opened this issue May 31, 2016 · 11 comments
Labels

Comments

@robwilkerson
Copy link

I'm working on a project that often runs hot and cold. As it happens, I haven't run a build in a little over a month (it's been a cold period). At the time, it worked just fine. Today, though, I tried to run a build and got this:

Module version mismatch. Expected 48, got 47.

In my project root, I have the following package.json:

{
  "name": "status-meter",
  "productName": "Status Meter",
  "description": "Status Meter is like a fuel gauge for your data allowance.",
  "homepage": "http://services.myclient.com/statusmeter",
  "repository": {
    "type": "git",
    "url": "https://bitbucket.org/owner/repo"
  },
  "dependencies": {
    "aws-sdk": "^2.2.15",
    "electron-builder": "^2.11.0",
    "electron-packager": "^6.0.2",
    "electron-prebuilt": "^0.36.0"
  },
  "scripts": {
    "clean": "rm -rf dist",
    "clean:osx": "rm -rf dist/osx",
    "clean:win": "rm -rf dist/win",
    "build": "npm run clean && npm run build:osx && npm run build:win",
    "build:osx": "npm run clean:osx && electron-packager ./app \"Status Meter\" --ignore=node_modules/.bin --out=dist/osx/ --platform=darwin --arch=x64 --version=0.36.12 --icon=\"build/assets/osx/Status Meter.icns\" --prune --app-bundle-id=\"com.myclient.statusmeter\" --app-version=$(node -e 'console.log(require(\"./app/package.json\").version)')",
    "build:win": "npm run clean:win && electron-packager ./app \"Status Meter\" --ignore=node_modules/.bin --out=dist/win/ --platform=win32 --arch=ia32 --version=0.36.12 --icon=\"build/assets/win/Status Meter.ico\" --prune --app-version=$(node -e 'console.log(require(\"./app/package.json\").version)')",
    "pack": "npm run pack:osx && npm run pack:win",
    "pack:osx": "npm run build:osx && electron-builder \"dist/osx/Status Meter-darwin-x64/Status Meter.app\" --platform=osx --out=dist/osx/ --config=build/config.json",
    "pack:win": "npm run build:win && electron-builder \"dist/win/Status Meter-win32-ia32\" --platform=win --out=dist/win/ --config=build/config.json",
    "nightly": "npm run pack && node bin/upload.js"
  }
}

I run the build by simply executing

$ npm run nightly

Locally, I'm running Node v6.0.0.

My issue seems similar to #39, but I'm not certain of that. I've been looking around for a map of electron version to the packaged node version, but haven't found one yet. Any advice would be a big help.

@develar
Copy link
Member

develar commented May 31, 2016

  1. Remove node_modules directory completely (rm -rf node_modules).
  2. Please ensure that you don't use sudo.
  3. npm install.

@develar
Copy link
Member

develar commented May 31, 2016

Locally, I'm running Node v6.0.0.

Please update to node 6.2.0. and npm install npm -g

@robwilkerson
Copy link
Author

@develar Thanks for your help. That seems to have done the trick, but I have to confess that I'm not sure why. I can't think of anything that should've changed (locally) since I last ran things. Would you mind taking a minute to explain what you clearly knew would change so I'll be more educated the next time around?

@develar
Copy link
Member

develar commented May 31, 2016

Would you mind taking a minute to explain what you clearly knew

Well, npm is not reliable and buggy. So, it is like a windows — if something goes wrong, first step is to reboot machine (i.e. remove cache and old node_modules) :)

@robwilkerson
Copy link
Author

@develar 😀 Fair enough. Thanks again.

@bitnom
Copy link

bitnom commented Aug 30, 2016

After spending a day on this I figured out the answer. If all else fails you need to install your packages and then run npm rebuild --runtime=electron --target=1.3.4 --disturl=https://atom.io/download/atom-shell --abi=49

where 1.3.4 is your electron version and 49 is the abi it's expecting.

@develar
Copy link
Member

develar commented Aug 30, 2016

@TomAshley303 Please see #683

@blue7wings
Copy link

@TomAshley303 work for me, npm rebuild --runtime=electron --target=[electron version] --disturl=https://atom.io/download/atom-shell --abi=[expected module version] , Thanks

@miguel-neurodigital
Copy link

The only solution working for me was with this command:
"npm install electron --save-dev"

Once added, my app works with "npm start" and after packing. Also notice that I'm using windows.

See ya!

@LJ149
Copy link

LJ149 commented Mar 31, 2017

Thanks a lot @develar

@aleksander351
Copy link

(Windows users) You can manage your node version with node version manager:
https://github.com/coreybutler/nvm-windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants