简体   繁体   中英

How to upgrade electron to latest version?

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.com/csepulv/electron-with-create-react-app

要将节点库升级到最新版本并在此实例中用于电子,您应该使用:

npm install electron@latest

What if electron forge is not compatible 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.org/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 command o
npm install -g npm@latest
 
# 7. Update electron or 
# https://www.electronjs.org/docs/latest/tutorial/updates#:~:text=The%20easiest%20way%20to%20use,with%20update.electronjs.org.&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 computer

## end update electron

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM