最近在运行一个React招聘网站移动端 | 技术栈 : React16+Antd+Router4+Redux+axios+Express+MongoDB |

项目地址:   https://github.com/TYRMars/React-Advertises

执行npm run start

报错

Failed to compile.

./src/index.js
Module build failed: ReferenceError: Unknown plugin "transform-decorators-legacy" specified in "C:\\Users\\72074530\\Desktop\\1234\\app\\package.json" at 1, attempted to resolve relative to "C:\\Users\\72074530\\Desktop\\1234\\app"
at Array.map (<anonymous>)

 

执行如下指令解决

npm install babel-plugin-transform-class-properties babel-plugin-transform-decorators-legacy babel-plugin-transform-export-extensions babel-plugin-transform-object-rest-spread babel-preset-env --save-dev

其实这个项目还需要额外:

npm install react-router-dom --save-dev

 并且注释掉:

解决:transform-decorators-legacy 报错

 

相关文章:

  • 2021-04-19
  • 2021-07-19
  • 2021-06-05
  • 2021-07-09
  • 2021-07-20
  • 2021-11-08
  • 2021-04-16
  • 2021-08-23
猜你喜欢
  • 2021-07-06
  • 2021-08-21
  • 2022-12-23
  • 1970-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案