TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

我的项目在mac上运行的很好,结果windows电脑,就一直报这个错误

解决方案: babel增加 

@babel/plugin-transform-modules-commonjs

参考文章:

https://www.cnblogs.com/dianzan/p/10676771.html 

网上搜到的答案如下:但是是老babel的解决,新的是这个 @babel/plugin-transform-modules-commonjs

原文地址:https://www.cnblogs.com/jcz1206/p/12250843.html