npm start TypeError 无法检测节点版本

编程入门 行业动态 更新时间:2024-09-26 02:23:00

npm start TypeError 无法检测<a href=https://www.elefans.com/category/jswz/34/1771452.html style=节点版本"/>

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 环境变量。为此,请按照以下步骤操作:

  1. 使用全局搜索超级按钮搜索“环境变量”
  2. 点击“编辑系统环境变量”
  3. 单击对话框中的“环境变量”。
  4. 在“系统变量”框中,搜索Path并将其编辑为 包括 C:\Program Files 奥德伊斯 奥德.exe; C:\Users{你的名字}\AppData\Roaming pm; 确保它与任何 其他路径通过 ;.

您必须重新启动所有当前打开的命令提示符才能生效。

这应该在运行本地服务器时读取您的节点版本

更多推荐

npm start TypeError 无法检测节点版本

本文发布于:2024-06-16 09:06:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1771446.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   版本   npm   start   TypeError

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!