ProgramingTip

Babel 7로 업그레이드 : null의 '바인딩'속 읽을 수 없습니다.

bestdevel 2020. 10. 11. 10:57
반응형

Babel 7로 업그레이드 : null의 '바인딩'속 읽을 수 없습니다.


다음 명령을 실행 하여 Babel 7 (6에서)로 업그레이드했습니다 .

npm remove babel-cli
npm install --save-dev @babel/cli @babel/core @babel/preset-env

.babelrc파일 은 다음과 가변 .

{ "presets": ["env"] }

그런 다음 실행했습니다.

babel js/src --out-dir js/dist

결과는 다음과 가변적입니다.

TypeError: Cannot read property 'bindings' of null
    at Scope.moveBindingTo (/xyz/node_modules/@babel/traverse/lib/scope/index.js:867:13)
    at BlockScoping.updateScopeInfo (/xyz/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
    at BlockScoping.run (/xyz/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
    at PluginPass.BlockStatementSwitchStatementProgram (/xyz/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
    at newFn (/xyz/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/xyz/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/xyz/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/xyz/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/xyz/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitSingle (/xyz/node_modules/@babel/traverse/lib/context.js:90:19)

내가 뭘 잘못 했어?


당신의 .babelrc파일 변경

{ "presets": ["env"] } 

...에

{ "presets": ["@babel/preset-env"] }

(아직 설치하지 않은 경우 해당 패키지를 설치하십시오).

당신은 .babelrc여전히 패키지를 참조하고 babel-preset-env(6.x에서입니다), 당신은 참조 할 @babel/preset-env(7.x의에 대한 인) 대신.

https://github.com/babel/babel/issues/6186#issuecomment-366556833

참고 URL : https://stackoverflow.com/questions/52092739/upgrade-to-babel-7-cannot-read-property-bindings-of-null

반응형