升级依赖报异常Error: Loading PostCSS Plugin failed: No valid exports main found for /node_modules/colorette

排查背景

artemis前端框架基于vue-element-admin开发,github提示某个组件版本过低,存在安全风险,就对用到的相关组件进行一次升级,升级后,却发现项目启动不了,报错信息如下:

Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Loading PostCSS Plugin failed: No valid exports main found for '/Users/xuzhanfu/Mate/Codes/2_Zaitong/6_Mate/mate-vue/node_modules/colorette'

问题定位

通过网上查找资料,发现stackoverflow讲解关于react类似的问题的解决方案是升级Node至14.5或者最新版本
URL如下所示:
https://stackoverflow.com/questions/62753723/create-react-app-starting-error-error-no-valid-exports-main-found-for-node

问题解决

通过升级Node至v12.18.3,问题解决
mac升级node方法

项目样例

可参考如下样例
https://gitee.com/matevip/artemis

猜你喜欢

转载自blog.csdn.net/bufegar0/article/details/107582490
今日推荐