In vscode, NPM run a vue2.X’s project directly threw an inexplicable error:
TypeError: Failed to load plugin 'vue' declared in '.eslintrc.js': createRequire is not a function
The general error description is as follows:
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.
How to Solve:
-
- 1. For VSCode, you can delete the eslint extension directly
-
- 2. Upgrade the node version to the latest or keep it consistent with the node version of your colleagues
Read More:
- [Solved] Vue2.0 Error: Syntax Error: TypeError: eslint.CLIEngine is not a constructor
- [Solution] VUE.js Load a local image with parameters in the script
- [Solved] Vue Route Error: Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function
- [Solved] Vue Error: Uncaught TypeError: Vue.createApp is not a function
- [Solved] Vue Project Error: Arrow function should not return assignment
- [Solved] Vue 3 Script Setup ESLint Error: ‘defineProps‘ is not defined
- vue.config.js build Package UglifyJsPlugin to clear console and print console.log Error: `warnings` is not a supported option
- [Solved] mqtt.js Error: n.createConnection is not a function
- [Solved] Vue uses webpack to package error: Createapp is not a function
- Vue Use scss Error: this.getOptions is not a function [How to Solve]
- Solution to build error in Vue project (error in static/JS)/vendor.xxxxx.js from UglifyJs)
- [Solved] component import error is declared in the statement of components
- [Solved] Vue3.0 Error: The component has been registered but not used vue/no-unused-components, Close eslint
- [Solved] Vue3.2 Error: Object.fromEntries is not a function
- Solution to some map files in JS folder after Vue packaging (remove the map. JS file)
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- [Solved] Failed to load config “react-app“ to extend from.
- [Solved] Nuxt Import qrcodejs2.js / QRCode.js Error: document is not defined
- ERROR in [eslint] ESLint is not a constructor (How to Solve)
- [Solved] Vue Project Error: Syntax Error: TypeError: this.getOptions is not a function