node版本问题
今天我把远程仓库的一个项目拉下来,然后我yarn run dev
报了一个这个错
我用nvm模拟一下当时的环境
node版本14.5.0,不支持
SyntaxError: The requested module 'vuepress/config' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
语法错误:请求的模块“vuepress/config”应为CommonJS类型,不支持命名导出。可以通过导入默认导出来导入 CommonJS 模块。
,也就是说不支持es6和typescript的一些模块语法,只能require...
网上找了半天资源,最好把node版本换为14.16.1
,得以解决,这玩意就这么玄乎,我也不知道为什么
上次更新: 2023/09/05 17:45:42