How to upgrade electron to latest version? - javascript

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

To 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 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

Related

Installing #angular/cli at version 9 but then reporting version 7

I am trying to update my global version of angular/cli to version 9, but after running the steps below I am still seeing version 7 installed.
Step 1
npm uninstall -g #angular/cli
Step 2
npm cache clean --force
also tried
npm cache verify
Step 3
npm install -g #angular/cli#latest
It uninstalls fine as when I run ng --version after the uninstall I do not see version of CLI installed. Yet, running this again after step 3 I see version 7 installed.
You have updated it globally. Have you tried removing node_modules in project folder ?
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev #angular/cli#latest
npm install

Unable to upgrade npm to npm#latest Mac [duplicate]

This question already has answers here:
How can I update NodeJS and NPM to their latest versions?
(64 answers)
Closed 4 years ago.
I'm on MacBook Air HighSierra v10.13.4.
I installed node from https://nodejs.org/ and it gave me npm#5.6.0.
I want to upgrade npm to the current lastest version.
So I've tired npm i npm#latest -g , npm i npm -g and sudo npm i npm -g.
It returns
/Users/sandeep/.npm-global/bin/npm -> /Users/sandeep/.npm-global/lib/node_modules/npm/bin/npm-cli.js
/Users/sandeep/.npm-global/bin/npx -> /Users/sandeep/.npm-global/lib/node_modules/npm/bin/npx-cli.js
+ npm#6.4.0
updated 1 package in 12.452s
But no good when I run npm -v it returns me 5.6.0.
But when i run npm list --depth=0 -g it shows npm#6.4.0.
Can someone pls help me with this ?
I will suggest you download macOS Installer node-v8.11.4.pkg and use your installer to install it.
Node: On default Latest LTS Version: 8.11.4 (includes npm 5.6.0)
After you install the default 8.11.4, run:
npm install -g npm
This should update you to the most recent version of npm.
I hope this helps.
You can upgrade to the latest version of npm using:
npm install -g npm#latest
Or upgrade to the most recent release:
npm install -g npm#next
You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.

Can't update nodejs with the sudo n stable trick, cannot stat error (Ubuntu 14.04)

I try the following :
Installing npm and nodejs through apt.
Installing the latest npm version, like :
npm npm#install -g
Ending up with nodejs version 0.10 or something, and npm version 3.10.8
I try to install n throught npm, like (seems to be the answer on most forums) :
sudo npm cache clean -f
sudo npm install -g n
Then, I try to install the crap :
sudo n stable
Get an error :
cp: cannot stat '/usr/local/n/versions/node//bin': No such file or directory
etc
etc
Any ideas ? All I want is to get the latest version of nodejs.
I have tried to download the node tar, but how can I get nodejs to become the same version as node ?
There is a good manager that will help you with all node versions.
It's called nvm(Node version manager).
https://github.com/creationix/nvm
All install guides are on git page. I install it like this.
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
bash install_nvm.sh
Check to see if everything installed correctly
nvm --version
Then when you want update node you can just do
nvm install 6.9.1 (or any version you like)
nvm alias default 6.9.1
nvm use default
After restarting of your terminal run
node -v you should have 6.9.1 installed and used.
Hope this helps.

Installing Angular-CLI on Windows 10

I had installation issues of angular-cli on Windows 10 system.
The errors were related to Python dependencies and node-gyp. Something as below :
>execSync#1.0.2 install C:\Users\UserName\AppData\Roaming\npm\node_modules\angular-cli\node_modules\execSync
node install.js
[execsync v1.0.2] Attempting to compile native extensions.
{ Error: spawn node-gyp ENOENT
at exports._errnoException (util.js:1007:11)
Update
this seems to be fixed in newer releases and this solution is no longer required.
mukesh51 eventually solved the problem.
the installation seems to work in these steps:
npm install -g node-gyp
npm install -g windows-build-tools
npm install -g #angular/cli
I took these steps from here.
Uninstall
npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli
Update Global package
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
I too faced the same issue initially when I installed angular directly using bash. The installation was error completely. Then I attempted to install locally in my project (without removing the global one). That appeared to have solved the problem but got an error on creating a new app.
So i uninstalled everything :
npm uninstall -g #angular/cli
and the reinstalled Angular using Windows Power Shell(as Admin)
npm install -g #angular/cli
This solved the entire problem! Hope it helps!
Use windows power shell to install angular-cli. It will run without any issues.
Windows 10 Solution
Look back at the trace of installation steps ... you may see that it found the Angular binary in the following location:
C:\Program Files\Git\usr\local\node_modules\#angular\cli\bin
I added an ENVT variable using this path and ng worked fine after that
I tried using npm install -g #angular/cli
npm downloaded files successfully and copied files to AppData but not able to use ng -v
After that, I tried following:
npm cache clean --force
Removes npm cache forcefully if you get warning using npm cache clean.
Then try
npm install -g #angular/cli#latest
I have successfully installed by trying the above solution in Windows10.
Both the CLI and generated project have dependencies that require Node 8.9 or higher, together with NPM 5.5.1 or higher.
try update node.js and npm
npm uninstall -g #angular/cli
npm install -g #angular/cli
if doesn't work:
Close the terminal, open a new one or use CMD or Git for windows instead.

How do I build backbone boilerplate with grunt?

I'm trying to build the backbone boilerplate project found here: https://github.com/backbone-boilerplate/backbone-boilerplate
I'm having some issues getting it to build properly. Here are the steps I've done which are the steps on the backbone-boilerplate wiki:
git clone https://github.com/backbone-boilerplate/backbone-boilerplate.git
cd backbone-boilerplate
sudo npm install -gq bower
sudo npm install -q
sudo npm install -gq grunt-cli
sudo grunt
At this point I get:
>> Local Npm module "grunt-cli" not found. Is it installed?
Warning: Task "requirejs" not found. Use --force to continue.
Aborted due to warnings.
Any ideas how to get this to build properly?
Specifying depth seems to work:
$ git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate.git
$ npm install
$ grunt
Also you may want to restart your terminal if that is your first time installing grunt-cli
You're running grunt under elevated privileges. Our documentation for building here:
https://github.com/backbone-boilerplate/backbone-boilerplate#build-process
... has you run that command under your own user. Give that a shot!
You need to ensure you build dependencies with bower, not just the node dependencies.
Getting Started
# Using Git, fetch only the latest commits. You won't need the full history
# for your project.
git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate
# Move the repository to your own project name.
mv backbone-boilerplate my-project
Updating Dependencies
# Install global dependencies. Depending on your user account you may need to
# gain elevated privileges using something like `sudo`.
npm install -g grunt-cli bower
# Optionally install coveralls (integration is baked in with Travis CI).
npm install -g coveralls
# Install NPM dependencies.
npm install
# Install Bower dependencies. ** THIS IS THE ONE YOU'VE MISSED **
bower install
Build Process
# To run the build process, run the default Grunt task.
grunt
# Run a build and test the now optimized assets.
grunt default server:release
If you have node installed correctly this should work like a charm.

Categories

Resources