节点版本"/>
npm start TypeError 无法检测节点版本
我正在尝试使用 npm start 运行反应应用程序。我使用的是 Node js 10.24.1,无法升级它,因为该项目是遗留项目。 我尝试强制清除缓存,删除node_modules和package-lock.json,但没有任何效果。我还尝试使用 gulp 任务,因为该项目需要使用 gulp run:backend 运行后端任务。之后,我使用 gulp run:dar-360。 dar-360 是我的应用程序的名称。 控制台中没有错误,但是应用程序无法在浏览器中启动,并且 chrome devtools 显示:
index.js:57 Uncaught TypeError: Unable to determine current node version
at versionIncluded (index.js:57:1)
at isCore (index.js:76:1)
at ../../node_modules/resolve/lib/core.js (core.js:12:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at ../../node_modules/resolve/index.js (index.js:3:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at ../../node_modules/tslint/lib/utils.js (utils.js:25:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at ./src/modules/maps/pages/map-page/components/help-modalponent.js (geo.helper.js:122:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at ./src/modules/maps/pages/map-page/map.page.js (map.page.css:45:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at ./src/components/app/appponent.js (appponent.css:45:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at ./src/index.js (index.css:45:1)
at __webpack_require__ (bootstrap:784:1)
at fn (bootstrap:150:1)
at 1 (service-worker.utils.js:56:1)
at __webpack_require__ (bootstrap:784:1)
at checkDeferredModules (bootstrap:45:1)
at Array.webpackJsonpCallback [as push] (bootstrap:32:1)
at main.chunk.js:1:67
回答如下:
您需要添加C:\Program Files 奥德伊斯 ode.exe; 和 C:\Users{yourName}\AppData\Roaming pm; 到您的 PATH 环境变量。为此,请按照以下步骤操作:
- 使用全局搜索超级按钮搜索“环境变量”
- 点击“编辑系统环境变量”
- 单击对话框中的“环境变量”。
- 在“系统变量”框中,搜索Path并将其编辑为 包括 C:\Program Files 奥德伊斯 奥德.exe; C:\Users{你的名字}\AppData\Roaming pm; 确保它与任何 其他路径通过 ;.
您必须重新启动所有当前打开的命令提示符才能生效。
这应该在运行本地服务器时读取您的节点版本
更多推荐
npm start TypeError 无法检测节点版本
发布评论