Downgrade npm: command line

Many nodejs apps like createreactnativeapp are designed to work over npm 4 and many of those remain un-ported to latest npm versions.

In such cases we would be needing to downgrade a working npm version that might be higher than the npm versions they work for.

In this respect, createreactnativeapp works only with 4 or lesser and if you have npm version 5 installed or higher, then you can easily downgrade it before using create react app by running:

sudo npm install -g npm@4

This will re-install / replace npm with version 4 as the runtime version. So even if for some reason you have to get 5 or latest npm back you can just use:

sudo npm install -g npm@5  ( or npm@latest for latest version ) ( or npm@next to get latest release )

 

Advertisements

Leave a Reply