{"id":568,"hash":"9b2e79ddedadeef4e6fa654acbba2df955a0a0f2f167fc8823fdabe272e96455","pattern":"Upgrade to Babel 7: Cannot read property &#39;bindings&#39; of null","full_message":"I just upgraded to Babel 7 (from 6) by running these commands:\n\nnpm remove babel-cli\nnpm install --save-dev @babel/cli @babel/core @babel/preset-env\n\nHere is my .babelrc file:\n\n{ \"presets\": [\"env\"] }\n\nThen I ran:\n\nbabel js/src --out-dir js/dist\n\nAnd it results in:\n\nTypeError: Cannot read property 'bindings' of null\n    at Scope.moveBindingTo (/xyz/node_modules/@babel/traverse/lib/scope/index.js:867:13)\n    at BlockScoping.updateScopeInfo (/xyz/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)\n    at BlockScoping.run (/xyz/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)\n    at PluginPass.BlockStatementSwitchStatementProgram (/xyz/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)\n    at newFn (/xyz/node_modules/@babel/traverse/lib/visitors.js:193:21)\n    at NodePath._call (/xyz/node_modules/@babel/traverse/lib/path/context.js:53:20)\n    at NodePath.call (/xyz/node_modules/@babel/traverse/lib/path/context.js:40:17)\n    at NodePath.visit (/xyz/node_modules/@babel/traverse/lib/path/context.js:88:12)\n    at TraversalContext.visitQueue (/xyz/node_modules/@babel/traverse/lib/context.js:118:16)\n    at TraversalContext.visitSingle (/xyz/node_modules/@babel/traverse/lib/context.js:90:19)\n\nWhat did I do wrong?","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"In your .babelrc file, change \n\n{ \"presets\": [\"env\"] } \n\nto \n\n{ \"presets\": [\"@babel/preset-env\"] }\n\n(and install that package if you haven't already).\n\nIn your .babelrc you are still referencing the package babel-preset-env (which is for 6.x), you want to reference @babel/preset-env instead (which is for 7.x).\n\n  https://github.com/babel/babel/issues/6186#issuecomment-366556833\n\nNote: you should also make this change in webpack.config.js if it is there as well.\n\nHere is the sample webpack config section where you should change the preset:\n\nuse: {\n  loader: 'babel-loader',\n  options: {\n    // Here you should change 'env' to '@babel/preset-env'\n    presets: ['@babel/preset-env'],\n  },\n},","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/52092739/upgrade-to-babel-7-cannot-read-property-bindings-of-null","votes":152,"created_at":"2026-04-19T04:51:22.567514+00:00","updated_at":"2026-04-19T04:51:22.567514+00:00"}