Windows版本Node.js常见问题及操作解决方式
-
-
- ERROR Error loading vue.config.js:
- npm v10.3.0 is known not to run on Node.js v14.21.3
- npm i时ERROR:reason: certificate has expired问题
- 清除node本地缓存
- npm 报错 [email protected] install: `node-pre-gyp install --fallback-to-build --update-binary
- ERROR Failed to compile with 5 errors These dependencies were not found:
-
ERROR Error loading vue.config.js:
ERROR Error loading vue.config.js:
ERROR Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: E:\0javaproject\code\oj-web\CodingFirstManagerWebCli\vue.config.js
require() of ES modules is not supported.
require() of E:\0javaproject\code\oj-web\CodingFirstManagerWebCli\vue.config.js from E:\0javaproject\code\oj-web\CodingFirstManagerWebCli\node_modules@vue\cli-service\lib\Service.js is an ES module file as it is a .js file whose nearest parent package.json contains “type”: “module” which defines all .js files in that package scope as ES modules.
Instead rename vue.config.js to end in .cjs, change the requiring code to use import(), or remove “type”: “module” from E:\0javaproject\code\oj-web\CodingFirstManagerWebCli\package.json.
加载vue.config.js时出错:
错误错误[ERR_REQUIRE_ESM]:必须使用导入来加载ES模块:E:\0javaproject\code\oj-web\CodingFirstManagerWebCl\vue.config.js
ES模块的require()不受支持。
E:\0javaproject\code\oj-web\CodingFirstManagerWebCl\vue.config.js的require()是一个ES模块文件,因为它是一个.js文件,其最近的父包.json包含“type”:“module”,将该包范围内的所有.js文件定义为ES模块。
请将vue.config.js重命名为.cjs结尾,将所需代码更改为使用import(),或从E:\0javaproject\code\oj-web\CodingFirstManagerWebCl\package.json中删除“type”:“module”。