vuejs / babel-plugin-transform-vue-jsx

babel plugin for vue 2.0 jsx
1.85k stars 132 forks source link

BabelJS Cannot find module 'babel-plugin-syntax-jsx' #167

Closed axelthat closed 5 years ago

axelthat commented 5 years ago

I recently updated my project. I did ncu -a to upgrade package.json and did npm i -g webpack-cli --save-dev and npm i webpack-cli --save-dev.

After that I did babel-upgrade --write --install. However, I am getting the following error:

    Error: [BABEL] /vue-project/src/main.js: Cannot find module 'babel-plugin-syntax-jsx' (While processing: "/vue-project/node_modules/babel-plugin-transform-vue-jsx/index.js")

Then did npm i --save babel-plugin-transform-vue-jsx which gave me the following errors:

    These dependencies were not found:

    * @babel/runtime/helpers/asyncToGenerator in ./src/store/modules/menu.js, ./src/store/modules/model.js and 10 others
    * @babel/runtime/helpers/defineProperty in ./src/store/modules/menu.js, ./src/store/modules/model.js and 11 others
    * @babel/runtime/helpers/objectDestructuringEmpty in ./src/store/modules/schema.js, ./src/store/modules/apiurl.js
    * @babel/runtime/helpers/objectSpread in ./src/store/modules/menu.js
    * @babel/runtime/helpers/slicedToArray in ./src/store/modules/builder.js
    * @babel/runtime/helpers/toConsumableArray in ./src/store/modules/menu.js
    * @babel/runtime/regenerator in ./src/store/modules/menu.js, ./src/store/modules/model.js and 10 others

How do I fix this?

luniks commented 5 years ago

@SanjayBanjade Not sure you have install the 4.0.1 version of the plugin (compatible with babel 7). You can try with npm i -D babel-plugin-transform-vue-jsx@4.0.1

Georgeek commented 5 years ago

@SanjayBanjade delete file ' .babelrc'. This should help.

Chang1ng commented 5 years ago

@SanjayBanjade delete file ' .babelrc'. This should help.

居然删除.babelrc

nickmessing commented 5 years ago

you can either install babel-plugin-syntax-jsx or just switch to the new preset for JSX: https://github.com/vuejs/jsx

liu-and-fei commented 5 years ago

为什么删除.babelrc,就可以了

UmbraCi commented 4 years ago

@SanjayBanjade删除文件'.babelrc'。这应该有所帮助。

why delete this file,can you tell me the reason?