在 Intellij IDEA 创建 Vue 项目时碰到如下错误:
Error: No valid exports main found for (Module path)
node_modules/vue/cli/estree-walker
从 Error: No valid exports main found for (Module path)大概猜测是 Node
版本的问题,因为我在终端输入 vue -V
查看版本,也经常有如下提醒
You are using Node v13.2.0.
Node.js 13.x has already reached end-of-life and will not be supported in future major releases.
It's strongly recommended to use an active LTS version instead.
我是 macOS 系统,所以安装和更新Node
都靠brew
但我 brew
仓库中Node
最新版本就是如上,好吧 只能更新 brew
仓库。
brew update
更新完再更新Node
brew upgrade node
再创建项目,错误已经没了。
本来考虑还不行,准备卸载重装Vue CLI
。
本文由老郭种树原创,转载请注明:https://guozh.net/error-no-valid-exports-main-found-for-module-path-node_modules/