Whats the best way to upgrade to the latest version of electron? Should I be concerned about any problems caused by upgrading?
I’m playing around with “electron”: “^1.7.9”, and “react”: “^16.1.1”, on linux. I’m using yarn, not npm;
The app I’m playing around with has never been ejected, so the assumed config is intact.
The codebase I'm using is here:
Whats the best way to upgrade to the latest version of electron? Should I be concerned about any problems caused by upgrading?
I’m playing around with “electron”: “^1.7.9”, and “react”: “^16.1.1”, on linux. I’m using yarn, not npm;
The app I’m playing around with has never been ejected, so the assumed config is intact.
The codebase I'm using is here: https://github./csepulv/electron-with-create-react-app
Share Improve this question asked May 28, 2019 at 17:16 Cloud 3000Cloud 3000 571 gold badge1 silver badge3 bronze badges 5- since you have your code on github you should be fine with just upgrading and seeing what breaks. Then when you're sure its working again, you mit the changes along side the version bump. Also see: christianengvall.se/update-to-latest-electron-version However since the latest version is 4 marjor version later than your version, you might just want to start over. – Olian04 Commented May 28, 2019 at 18:06
- btw, why are you playing around with a 2 year old version? – Olian04 Commented May 28, 2019 at 18:08
- I wanted to find the cleanest electron/react boilerplate, something not too plicated, as I'm trying to learn the basics of electron and react. This one fit the bill, with one exception, it was using very old versions. – Cloud 3000 Commented May 28, 2019 at 19:22
- I tried to upgrade using " "yarn global upgrade --latest", all ran with no errors, but nothing was upgraded. However electron -v says 1.8.8, but package.json says 1.7.9 – Cloud 3000 Commented May 28, 2019 at 19:25
- OK I got it upgraded by changing “electron”: “^1.7.9” to “electron”: “@”, in the package.json file. And then ran "yarn install", yarn asked me to pick a version, and gave me a list to pick from... I chose 5.0.2. then yarn build and all works fine...... :-) – Cloud 3000 Commented May 28, 2019 at 19:35
2 Answers
Reset to default 7To upgrade the node library to the latest version and for electron in this instance you should use:
npm install electron@latest
What if electron forge is not patible with node js? You need to update everything with the latest version.
## update electron
# 1. Check node version or if use nvm auto script -> nvm ls
node -v
# 2. clean cache
npm cache clean -f
# 3. Download and install from here https://nodejs/en/download/
# 4. install node version n Latest LTS Version: 16.15.0 (includes npm 8.5.5)
# Install n globally
# or --> npm install -g npm stable
npm install -g n latest
# 5
npm install -g npm
# 6 Then update node or npm install -g n
npm install -g node
# 7 update node and npm in one mand o
npm install -g npm@latest
# 7. Update electron or
# https://www.electronjs/docs/latest/tutorial/updates#:~:text=The%20easiest%20way%20to%20use,with%20update.electronjs.&text=By%20default%2C%20this%20module%20will,be%20downloaded%20in%20the%20background.
npm install electron@latest
npm install update-electron-app
# 8. check node version and electron version
# 9. Restart puter
## end update electron