-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Question: migrate global npm packages #481
Comments
I second this, can we push for this to happen? |
I believe the
I'd love to see |
It’s It will reinstall packages as well as copy over symlinks (from |
I use this for migrating global packages (assuming we are currently on the newer version): fnm_upgrade () {
fnm exec --using=$1 npm ls --global --json \
| jq -r '.dependencies | to_entries[] | .key+"@"+.value.version' \
| xargs npm i -g
}
# Usage:
$ fnm_upgrade 18.4 |
Has anyone managed to create a script for windows PS? |
I switched to pnpm for global packages, which sort of solved this issue for me as pnpm keeps packages in a global folder, not tied to a particular version of node. Might be helpful for someone else as well. |
That’s surprising since global packages must be tied to a particular version of node, since installed and compiled packages can differ based on the node version. |
I created a simple script and uploaded it to GitHub Gist. Running the command below will install the LTS version of Node.js and reinstall the global packages that are installed in the current Node.js version. You can also specify the Node.js version you want to install using the -v option. curl -fsSL https://gist.githubusercontent.com/romantech/83ac87cea4e9a6d7a0985f610df329e5/raw/decd27fb4fb3c0aa6563a74e000dc00974f6f1e9/update-node-lts.sh | bash -s -- -v <version> |
Hello,
Thank you for this great tool!
I was wondering, what's the "recommended" way to migrate globally installed npm packages when moving from one version to another?
Thanks again!
The text was updated successfully, but these errors were encountered: