You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to install a new version of Node.js and migrate npm packages from a previous version:
365
365
366
366
```sh
367
-
nvm install node --reinstall-packages-from=node
367
+
nvm install --reinstall-packages-from=node node
368
368
```
369
369
370
370
This will first use "nvm version node" to identify the current version you're migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs "nvm reinstall-packages" to reinstall the npm packages from your prior version of Node to the new one.
371
371
372
372
You can also install and migrate npm packages from specific versions of Node like this:
373
373
374
374
```sh
375
-
nvm install 6 --reinstall-packages-from=5
376
-
nvm install v4.2 --reinstall-packages-from=iojs
375
+
nvm install --reinstall-packages-from=5 6
376
+
nvm install --reinstall-packages-from=iojs v4.2
377
377
```
378
378
379
379
Note that reinstalling packages _explicitly does not update the npm version_ — this is to ensure that npm isn't accidentally upgraded to a broken version for the new node version.
380
380
381
381
To update npm at the same time add the `--latest-npm` flag, like this:
0 commit comments