Skip to content

Instantly share code, notes, and snippets.

@jomasero
Last active November 2, 2022 16:10
Show Gist options
  • Save jomasero/188428809f6e55e214ba16c5930bf6d5 to your computer and use it in GitHub Desktop.
Save jomasero/188428809f6e55e214ba16c5930bf6d5 to your computer and use it in GitHub Desktop.

My weekly steps for updating Node.js and related tools

A. Node.js (via nvm in Windows)

1. Install latest LTS/Current Node version

> nvm list                //To check installed versions
> nvm install 14.14.0     //Replace by the version you want to install
> nvm use 14.14.0
> nvm uninstall 14.13.1   //Clean if you need to

2. General check and safe update npm packages

> npm outdated
> npm update
  • Additionally, it can be used:
    • npx npm-check-updates -u
    • npm install {specific_package_name}

B. Angular via angular-cli

1. Update cli globally

> npm install -g @angular/cli@latest

//[Re]install project if necessary
> rm -r ./node_modules
> rm package-lock.json
> npm install

2. Update project packages

> ng update
> ng update @angular/cli @angular/core    //Add --allow-dirty flag if necessary
> ng update {each_specific_package_name}

C. Loopback 4

> npm i -g @loopback/cli
> lb4 update

D. React (create-react-app)

//Replace "4.X.X" by the react-script version you need
> npm install --save --save-exact react-scripts@4.X.X

E. Next.js

> npm i next@latest react@latest react-dom@latest eslint-config-next@latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment