Cannot update from Gatsby 2.12.78 to 3.X globally - node.js

I have tried running npm i -g gatsby-cli and sudo npm i -g gatsby-cli but when I run gatsby --version it still says 2.12.78 even though it also says "Update available 2.12.78 → 3.10.0 | Run npm i -g gatsby-cli to update"
These are my package versions:
npm version: 7.19.1
node version: v16.5.0
Gatsby CLI version: 2.12.78

You just need to follow the migration guide:
npm install gatsby#latest
All gatsby-* should be upgraded too, but without updating the global Gatsby package you can't update the related ones. Check them by:
npm outdated

Related

Failed to install Vue.js Cli

node -v: v8.10.0
npm -v: 3.5.2
While running npm install -g #vue/cli or sudo npm install -g #vue/cli I get the error below and failed to download Vue CLI
You are using a rather old version of npm. The current version is 6.9.0, and the packages you are working with are asking for npm >= 5.5.1.
You need to update your node version, if possible always use latest node version
Nodejs version 14.4.
And if you have project that required different node version then use
NVM - node version manager
Just use sudo for global install
sudo npm install -g #vue/cli

How to install gatsby?

When I try to install gatsby running npm install gatsby-cli -g , it shows that is successfuly installed but it does not work when I run gatsby --help oder gatsby -- build .... , it shows:
-bash: gatsby: command not found
the reason you are getting that is that you haven't installed it globally
$ npm i -g gatsby
$ source ~/.bashrc
source will refresh your terminal so you don't need to close it and open it up again
cli commands only work with globally installed packages
The Gatsby CLI is available via npm and should be installed globally by running:
npm install -g gatsby-cli
If you are unable to successfully run the Gatsby CLI due to a permissions issue, you may want to check out the npm docs on fixing permissions.
global flag -g comes first while installing any package
instead of npm install gatsby-cli -g run npm i -g gatsby-cli
any of below will work
npm install --global <package_name_to_install>
npm install -g <package_name_to_install>
npm i --global <package_name_to_install>
npm i -g <package_name_to_install>
for you package_name_to_install is gatsby-cli

Upgrade to v3.8.0 but still showing "Welcome to the JHipster Generator v3.3.0"

I have performed
npm install -g generator-jhipster
with and without sudo on my ubuntu machine but it keeps showing
Welcome to the JHipster Generator v3.3.0 and
JHipster update available: 3.8.0 (current: 3.3.0)
You could use the update command, or installing at the specific version.
npm update -g generator-jhipster
npm install -g generator-jhipster#3.8.0
https://docs.npmjs.com/cli/update
https://docs.npmjs.com/cli/install
Working now, I think a local copy was hiding global one
I did following
npm update generator-jhipster
npm install generator-jhipster#3.8.0

Start with fresh copy of node, npm and cordova

I had a makeshift setup on Lubuntu that 'functioned' with sudo npm install. I used Ionic Framework generator to create projects and they functioned as well as the builds and deployment.
I upgraded to 15.04 and ever since had problems finding a solution that worked does not give EACCESS errors or grunt serve telling me
Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:
Please update your Node runtime to version >=0.12.x
Please update your Cordova CLI to version >=4.2.0 npm install -g cordova
then for npm install -g cordova to tell me
npm WARN engine cordova-serve#0.1.3: wanted: {"node":">= 0.12.0","npm":">= 2.5.1"} (current: {"node":"0.10.26","npm":"2.12.1"})
I have tried the "chown -R whoami /dir/of/npm"
I have delete npm, node install brew and created new installs for all.
I still get EACCESS errors, my yo ionic "grunt serve" deploys the browser but gives ERR_CONNECTION_REFUSED
I installed brew, manually deleted the npm folder and did a clean install. No joy
which node - /home/username/.nvm/v0.10.26/bin/node
node -v v0.10.26
which npm - /home/userna/.linuxbrew/bin/npm
npm -v 2.12.1
which cordova - /usr/local/bin/cordova
cordova -v 3.5.0-0.2.6
And for good meassure i thought if i installed node4 all my troubles would disappear.
I know i messed this up but i would like a clean start with node, npm(without sudo) and cordova. Any help would be appreciated
Ps: I have done most of the normal suggestions hence my question.
Did you installed node using nvm?
So try
nvm use 4.0.0
In general:
nvm install [VERSION]
nvm use [VERSION]
To use permanent:
nvm alias default [VERSION]
try also to install cordova again after updating node
npm install -g cordova
If all fails:
Uninstall node and reinstall propper using brew:
cd ~
sudo rm -rf .npm
brew update
brew uninstall npm
brew install npm

npm update includes pre-release

There is a package, which has a latest version of 2.1.3, and a pre-release version of 3.0.0-rc.7. When I run npm install package -g, 2.1.3 is installed. When I run npm update -g, it updates to the pre-release (which I had installed previously, but removed later). Does npm keep a record of the pre-release being the latest?
$ package -v
2.1.3
$ sudo npm update -g package
$ package -v
3.0.0-rc.7
$ sudo npm remove package -g
$ sudo npm install package -g
$ package -v
2.1.3
The package registry gives "latest":"2.1.3" and "pre":"3.0.0-rc.7". I'm using npm 1.4.13 and node 0.10.28.
Yes, an npm repository can keep several different dist-tags, with latest being the default when publishing and installing. See npm dist-tag documentation.
The semver concept of a pre-release identifier and the npm concept of a non-default dist-tag are distinct, but it is probably a best-practice use them together if a package author chooses to npm publish any pre-release versions. For example, when publishing a release-candidate, it might be appropriate to tag it with next. For a more complex example, see the output from this command:
C:> npm dist-tag ls npm
3.x-latest: 3.9.6
3.x-next: 3.10.1
latest-1: 1.4.29
latest-2: 2.15.6
latest: 3.9.6
lts: 2.15.6
next-2: 2.15.8
next: 3.10.1
v3.x-latest: 3.9.6
v3.x-next: 3.10.1

Resources