Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm upgrading to latest with Homebrew

I'm looking for an official procedure to update the version of the npm included in node (installed via homebrew).

cli configs

metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.4.1 node/v11.4.0 darwin x64"
userconfig /Users/antoniomavaro/.npmrc
prefix = "/Users/antoniomavaro/.npm-packages"
node bin location = /usr/local/Cellar/node/11.4.0/bin/node
cwd = /Users/antoniomavaro
HOME = /Users/antoniomavaro

Installing via npm install npm @latest -g I install npm as a module in its own right but it does not updates the bundled version installed with homebrew.

Anyone can help me?

like image 260
Antonio Mavaro Avatar asked Oct 17 '22 09:10

Antonio Mavaro


People also ask

How can I update my NodeJS to the latest version?

As an alternative, you can use Node's official package manager to update Node.js. NPM is a tool for installing and managing package dependencies. If you have Node on your system, you have NPM, as well. With the npm command, you can check running Node.js versions and install the latest release.


1 Answers

With Homebrew, it should work out of the box. Is it what I've done:

$ which npm
/usr/local/bin/npm

$ npm --version
6.4.1

$ npm install -g npm
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
added 2 packages from 1 contributor and updated 14 packages in 8.139s

$ npm --version
6.5.0
like image 196
Ortomala Lokni Avatar answered Oct 20 '22 16:10

Ortomala Lokni