{"id":19181382,"url":"https://github.com/uid11/fix-nvm-update","last_synced_at":"2026-07-29T00:31:57.663Z","repository":{"id":57237627,"uuid":"70053052","full_name":"uid11/fix-nvm-update","owner":"uid11","description":"Move installed global npm packages from old Node version to new one (only for nvm)","archived":false,"fork":false,"pushed_at":"2016-10-13T20:58:55.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T21:47:29.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uid11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-05T11:12:28.000Z","updated_at":"2016-10-05T11:14:20.000Z","dependencies_parsed_at":"2022-08-26T15:01:17.176Z","dependency_job_id":null,"html_url":"https://github.com/uid11/fix-nvm-update","commit_stats":null,"previous_names":["uid-11222/fix-nvm-update"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/uid11/fix-nvm-update","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uid11%2Ffix-nvm-update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uid11%2Ffix-nvm-update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uid11%2Ffix-nvm-update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uid11%2Ffix-nvm-update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uid11","download_url":"https://codeload.github.com/uid11/fix-nvm-update/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uid11%2Ffix-nvm-update/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36012773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-28T02:00:06.341Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T10:53:13.338Z","updated_at":"2026-07-29T00:31:57.641Z","avatar_url":"https://github.com/uid11.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fix-nvm-update\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n![node][node-image]\n![dependencies][dependencies-image]\n[![License MIT][license-image]](LICENSE)\n\n[![NPM version][nodei-image]][nodei-url]\n\n**fix-nvm-update** quickly move all global npm packages from old Node version to new (only for versions, installed via [NVM](https://github.com/creationix/nvm)), without reinstalling.\n\n## Usage\nYou need a node version \u003e=6.0.0.  \nInstall **fix-nvm-update** localy or global, and set your current version of Node:\n```bash\n$ fix-nvm-update set last v6.6.0\n```\nCheck your nvm nodes directory (**~/.nvm/versions/node** by default):\n```bash\n$ fix-nvm-update get\n```\nIf needed, change it:\n```bash\n$ fix-nvm-update set nodes /home/user/.nvm/versions/node\n```\nAfter installing new Node version just run **fix-nvm-update** with this new version:\n```bash\n$ nvm install v6.7.0\n$ ../src/fix-nvm-update.js v6.7.0\n```\nIt's not a problem if **fix-nvm-update** installed globaly and move itself with other global packages. In this case your need run **fix-nvm-update** from old Node version (because new version has not global packages yet):\n```bash\n$ nvm install v6.7.0\n$ nvm use v6.6.0\n$ fix-nvm-update v6.7.0\n$ nvm use v6.7.0\n```\nNow all global packages are in v6.7.0 (includes **fix-nvm-update**).\n\nThis will show usage and version:\n```bash\n$ fix-nvm-update help\n```\n\n## Why\n[NVM](https://github.com/creationix/nvm) offers a official way of updating: [Migrating global packages while installing](https://github.com/creationix/nvm#migrating-global-packages-while-installing).\n```bash\n$ nvm install v6.7.0 --reinstall-packages-from=v6.6.0\n```\nIt works, but this solution has a problems:\n - all packages reinstalled -- it's take a long time\n - all packages reinstalled -- so they lose their internal \"state\" (but may be this is correct behaviour and packages should not have some state)\n - old packages do not deleted, but they could weight more then 100 Mb\n - old bin links do not deleted (but there is no real problem with that)\n\nBut simple moving packages to new Node version directory works very quickly. **fix-nvm-update** does it carefully with full logging (in stdout).\n\n\n## How\nLet current directory is the path of Node versions, **old** -- your old Node version, and **new** -- the new one. Then **fix-nvm-update** just run commands:\n```bash\n$ mkdir tmp\n\n$ mv old/lib/node_modules/* tmp\n$ mv tmp/npm old/lib/node_modules\n$ mv tmp/* new/lib/node_modules\n\n$ mv old/bin/* tmp\n$ mv tmp/npm tmp/node nodes/old/bin\n$ mv tmp/* new/bin\n\n$ rmdir tmp\n```\nSo, **npm** package, and bin links to **npm** and **node** do not moving.\n\n## Tests\n30 tests via Mocha:\n```bash\n$ npm install\n$ npm test\n```\nTravis: https://travis-ci.org/uid-11222/fix-nvm-update.\n\n## License\n[MIT](LICENSE)\n\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg \"The MIT License\"\n\n[travis-image]: https://img.shields.io/travis/uid-11222/fix-nvm-update.svg \"status on travis\"\n[travis-url]: https://travis-ci.org/uid-11222/fix-nvm-update \"travis\"\n\n[dependencies-image]: https://img.shields.io/gemnasium/mathiasbynens/he.svg?maxAge=2592000 \"dependencies: none\"\n\n[node-image]: https://img.shields.io/badge/node-v6.0.0-brightgreen.svg?maxAge=2592000 \"node: \u003e=v6.0.0\"\n\n[npm-image]: https://img.shields.io/npm/v/fix-nvm-update.svg \"fix-nvm-update on npm\"\n[npm-url]: https://www.npmjs.com/package/fix-nvm-update \"fix-nvm-update\"\n\n[nodei-image]: https://nodei.co/npm/fix-nvm-update.png \"fix-nvm-update on npm\"\n[nodei-url]: https://nodei.co/npm/fix-nvm-update/ \"fix-nvm-update on npm\"","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuid11%2Ffix-nvm-update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuid11%2Ffix-nvm-update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuid11%2Ffix-nvm-update/lists"}