在VScode中npm run了一个vue2.X的项目时直接抛出了一个莫名其妙的错误
TypeError: Failed to load plugin 'vue' declared in '.eslintrc.js': createRequire is not a function
大致错误描述如下:
ERROR Failed to compile with 1 error 16:42:37 Syntax Error: TypeError: Failed to load plugin 'vue' declared in '.eslintrc.js': createRequire is not a function Referenced from: D:\codeSource\myProject\ldsz-cloud\ui-ldsz-adm\.eslintrc.js at _normalizeObjectConfigDataBody.next (<anonymous>) at _normalizeObjectConfigData.next (<anonymous>) You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.
处理方式:
- 针对于VSCode,可以直接删除eslint扩展
- 升级node版本至最新或与同事的node版本保持一致