vue-cli 3.9.0新建项目运行时报错

Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'E:\workSpace\test\node_modules\babel-loader\lib\index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    ......

reason:

For anyone else diving into it, I think it's related to this change in eslint-loader that was meant to help support eslint 6. It's adding /package.json in situations where the userEslintPath seems to already be a file rather than a directory. This is resulting in eslint-loader trying to find the .../api.js/package.json path.

solution:

For npm users it should just be

npm i eslint-loader@2.1.2
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容