{"id":19372,"library":"babel-upgrade","title":"babel-upgrade","description":"A tool to automatically upgrade Babel 6 projects to Babel 7. It updates dependencies, config files (.babelrc, babel key in package.json), and JavaScript files that import Babel packages directly. Stable version is v1.0.1, though previously released as v0.x. No regular release cadence; last release was in 2019. Key differentiators: it automates the rename of packages (e.g., babel-preset-env → @babel/preset-env), adds necessary peer dependencies, and handles monorepos. It is a one-time migration tool, not a general Babel upgrade utility.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/babel/babel-upgrade","tags":["javascript","babel","babel 7","babel-upgrade","codemod"],"install":[{"cmd":"npm install babel-upgrade","lang":"bash","label":"npm"},{"cmd":"yarn add babel-upgrade","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-upgrade","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Requires Node >= 8. Use npx to run without global install.","wrong":"babel-upgrade (without --write will only print diff)","symbol":"default (run via CLI)","correct":"npx babel-upgrade --write"},{"note":"The package is CJS-only; there is no ESM export.","wrong":"import upgrade from 'babel-upgrade' (ESM not supported)","symbol":"Programmatic API (if any)","correct":"const upgrade = require('babel-upgrade');"},{"note":"--write to apply changes, --install to run npm/yarn after.","wrong":"npx babel-upgrade (without flags as above)","symbol":"CLI flags","correct":"npx babel-upgrade --write --install"}],"quickstart":{"code":"npx babel-upgrade --write --install","lang":"typescript","description":"Run babel-upgrade with --write to modify files and --install to update node_modules."},"warnings":[{"fix":"Update Node.js to >= 8.0.0.","message":"Node.js >= 8.0.0 required.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Review the diff output carefully; run tests after upgrade.","message":"Upgraded projects may need manual adjustment for edge cases like custom Babel plugins.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Add --write or -w flag to apply changes.","message":"Without --write, only a diff is printed; no changes are made.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use npm >= 5.2.0 or manually run install after upgrade.","message":"The --install flag may not work with npm versions < 5.2.0 (npx not available).","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Manually rename any custom or third-party presets/plugins that were not renamed.","message":"Does not handle presets or plugins that are not in the known rename list.","severity":"breaking","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Upgrade npm to >= 5.2.0 or install babel-upgrade globally and run without npx.","cause":"npx is not available with older npm versions (< 5.2.0).","error":"npx: command not found"},{"fix":"Update Node.js to version 8.0.0 or higher.","cause":"Node.js version is too old.","error":"Error: Your Node.js version is not supported. Please upgrade to Node.js >= 8.0.0."},{"fix":"Run 'npx babel-upgrade' or install globally: 'npm install -g babel-upgrade'.","cause":"babel-upgrade is not installed globally and npx is not used.","error":"babel-upgrade: command not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}