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

Cannot run with Node 10 #831

Closed
mattridley opened this issue Apr 25, 2018 · 21 comments
Closed

Cannot run with Node 10 #831

mattridley opened this issue Apr 25, 2018 · 21 comments

Comments

@mattridley
Copy link

When packaging my electron app with Node 10 I get the following error in the console.

CANNOT RUN WITH NODE 10.0.0
Electron Packager requires Node 4.0 or above.

In cli.js the check evaluates to [10, 0, 0] < [4, 0, 0] which is true, whereas previously [9, 0, 0] returns as false.

I'll raise a PR now to simplify this check so it continues to work with newer versions of node.

@welcome
Copy link

welcome bot commented Apr 25, 2018

👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@Joni4Games
Copy link

Any solution yet? Do we have to downgrade to node 4.x?

@Triforcey
Copy link

@Joni4Games It is patched. Just use the latest 9.x release until the fix is published.

@malept
Copy link
Member

malept commented May 3, 2018

Thanks for your patience, a fix has been released in 12.0.2.

@psharneja
Copy link

well, i'm using version 12.1.0 and issue remains the same

@malept
Copy link
Member

malept commented May 27, 2018

@psharneja I cannot reproduce this. My steps (on Linux):

# step 0: install nodeenv <https://github.com/ekalinin/nodeenv>
nodeenv -n 10.2.1 node10
source node10/bin/activate
git clone https://github.com/electron-userland/electron-packager
cd electron-packager
npm install
./cli.js --version

My output:

Electron Packager 12.1.0
Node v10.2.1
Host Operating system: linux (x64)

@Triforcey
Copy link

On my system the issue also appears to be fixed in 12.1.0.

@jsejcksn
Copy link

jsejcksn commented Jul 3, 2018

I am beginning to learn about Electron through the electron-api-demos app. When trying to run npm run-script package I also get this error.

I am running the following versions:

  • Node: 10.4.1
  • electron-packager: 12.1.0
  • macOS 10.13.5

@malept
Copy link
Member

malept commented Jul 3, 2018

@jsejcksn if you run npm run package -- --version and it doesn't immediately print out the Electron Packager version and exit, you don't have Electron Packager 12.1.0 installed. In that case, run npm update.

@jsejcksn
Copy link

jsejcksn commented Jul 3, 2018

Hi @malept: Thanks for responding. Running your example command produces an error:

$ npm run-script package -- --version

> [email protected] package /path/to/electron-api-demos
> npm-run-all package:* "--version"

ERROR: Invalid Option: --version

I thought I was running v 12.1.0 of electron-packager because of the output of npm view electron-packager version. However, I realized my mistake—that it is showing me the info for the package at the npm registry and not my local package. I then ran npm list electron-packager, which produced

[email protected] /path/to/electron-api-demos
└── [email protected]

Running npm update or npm update electron-packager will not increase the installed version of electron-packager because of the use of the ^ in package.json. The caret prohibits updating it beyond the major version number, in this case, 8.x.x.

I see that you are also a member of the electron-api-demos repo. Perhaps you can address this issue there by changing the ^ to >=? As it stands, users cannot install and test packaging the app when running the latest version of Node.

@malept
Copy link
Member

malept commented Jul 3, 2018

I see that you are also a member of the electron-api-demos repo.

I am a member but not an active contributor.

Perhaps you can address this issue there by changing the ^ to >=?

That seems like a bad idea, because when I increment the major version number, I do so deliberately - per the semantic versioning spec, that's when command line flags can get removed, which can break someone's usage of the CLI. It would be better if someone just version bumped Electron Packager in package.json.

@jsejcksn
Copy link

jsejcksn commented Jul 3, 2018

@malept I agree about semver practices, however, there may be another internal reason (unknown to me) not to bump the required major version, which is why I suggested a different operator instead. Which member do you suggest I contact about this since you are unable to address it?

@malept
Copy link
Member

malept commented Jul 3, 2018

You should just file a pull request instead of contacting someone.

@jsejcksn
Copy link

jsejcksn commented Jul 3, 2018

@malept So there are no reasons the package is still set to major version 8? Nothing would prohibit the team from accepting a PR to bump it to 12?

@malept
Copy link
Member

malept commented Jul 3, 2018

I don't know the answer to that without looking at the project.

@lukyanov
Copy link

lukyanov commented Sep 27, 2018

Issue still persists:

$ node --version
v10.11.0

$ npm list electron-packager
buymeapie@ /Users/snaky/Dev/baton/baton.web.app.git
└── [email protected]

$ electron-packager 
CANNOT RUN WITH NODE 10.11.0
Electron Packager requires Node 4.0 or above.

MacOs 10.13.6

Node is installed with brew.

@malept
Copy link
Member

malept commented Sep 27, 2018

@lukyanov You have an old version installed globally, that's what's running when you just run electron-packager. Try node_modules/.bin/electron-packager instead, which will run the version installed relative to your Node app (assuming you're in the root directory of your Node app). (You should uninstall the globally installed version so you're not confused.)

@dogancelik
Copy link

dogancelik commented Jan 1, 2019

Is Node 11 going to be supported soon? (It was released 3 months ago)

CANNOT RUN WITH NODE 11.3.0
Electron Packager requires Node 4.0 or above.

@malept
Copy link
Member

malept commented Jan 1, 2019

@dogancelik see #831 (comment)

@rmraya
Copy link

rmraya commented Jan 2, 2019

Still broken with node 10.11.0 which is the official version used by electron 4.0.0

@malept
Copy link
Member

malept commented Jan 2, 2019

@rmraya

First, the version bundled with Electron has no bearing on the version of Node that is required by Electron Packager to run, unless for some bizarre reason you're using Electron itself to run Electron Packager.

Second, as I mentioned several times in this issue: the bug has been fixed in 12.0.2 and above.

I'm locking this issue because this is becoming unproductive for me.

To reiterate for users who think they cannot run Electron Packager with the latest version of Electron Packager:

If you installed Electron Packager in your project (recommended over installing globally):

  • On Windows, in your project directory, run node_modules\.bin\electron-packager --version
  • On all other platforms, in your project directory, run node_modules/.bin/electron-packager --version

If that command doesn't print out the version number of Electron Packager, your globally installed version of Electron Packager is too old.

If you installed Electron Packager globally: run electron-packager --version. If that doesn't print out the version number of Electron Packager, your globally installed version of Electron Packager is too old.

If you still run into this and you have double-checked that all versions of Electron Packager on your system and projects are 12.0.2 or greater, please file a new issue, making sure to fill out the issue template, and mention the Electron Packager version you installed.

@electron electron locked as resolved and limited conversation to collaborators Jan 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants