Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Intellij IDEA Node.js类型脚本调试器不工作_Node.js_Typescript_Intellij Idea - Fatal编程技术网

Intellij IDEA Node.js类型脚本调试器不工作

Intellij IDEA Node.js类型脚本调试器不工作,node.js,typescript,intellij-idea,Node.js,Typescript,Intellij Idea,我正在做一个Node.js项目,它使用typescript。我使用以下命令启动项目: ./node_modules/.bin/ts-node ./handle-uploaded-image/app.ts 这是完美的。每当我试图通过Intellij IDEA以调试模式启动项目时,我都会遇到以下错误: ./handle-uploaded-image/node_modules/.bin/ts-node ./handle-uploaded-image/app.ts Debugger listenin

我正在做一个Node.js项目,它使用typescript。我使用以下命令启动项目:

./node_modules/.bin/ts-node ./handle-uploaded-image/app.ts
这是完美的。每当我试图通过Intellij IDEA以调试模式启动项目时,我都会遇到以下错误:

./handle-uploaded-image/node_modules/.bin/ts-node 
./handle-uploaded-image/app.ts
Debugger listening on ws://127.0.0.1:61933/6d785785-a696-44da-8256-9123895981ed
For help, see: https://nodejs.org/en/docs/inspector
env: node: No such file or directory
Error in JetBrains node debug connector:  Error: Command failed: 
./handle-uploaded-image/node_modules/.bin/ts-node 
/private/var/folders/y4/b5h5p9wj471d3zzz_vn8t8dw0000gn/T/debugConnector.201.7223.91.js
    at checkExecSyncError (child_process.js:611:11)
    at execFileSync (child_process.js:629:15)
    at Object.<anonymous>             
(/private/var/folders/y4/b5h5p9wj471d3zzz_vn8t8dw0000gn/T/debugConnector.201.7223.91.js:30:3)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1345:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:439:5) {
  status: 127,
  signal: null,
  output: [ null, null, null ],
  pid: 25469,
  stdout: null,
  stderr: null
}
/handle上传图像/node\u modules/.bin/ts节点
/处理上传的图像/app.ts
在ws://127.0.0.1:61933/6d785785-a696-44da-8256-9123895981ed上侦听的调试器
有关帮助,请参阅:https://nodejs.org/en/docs/inspector
env:node:没有这样的文件或目录
JetBrains节点调试连接器中出错:错误:命令失败:
/处理上传的图像/节点\模块/.bin/ts节点
/private/var/folders/y4/b5h5p9wj471d3zzz_vn8t8dw0000gn/T/debugConnector.201.7223.91.js
在checkExecSyncError(child_process.js:611:11)
在execFileSync(child_process.js:629:15)
反对。
(/private/var/folders/y4/b5h5p9wj471d3zzz_vn8t8dw0000gn/T/debugConnector.201.7223.91.js:30:3)
at模块编译(内部/modules/cjs/loader.js:1200:30)
在Object.Module._extensions..js(internal/modules/cjs/loader.js:1220:10)
在Module.load(内部/modules/cjs/loader.js:1049:32)
at Function.Module._load(内部/modules/cjs/loader.js:937:14)
at Module.require(内部/modules/cjs/loader.js:1089:19)
at模块。_预加载模块(内部/modules/cjs/loader.js:1345:12)
在LoadPreloadModule(内部/bootstrap/pre_execution.js:439:5){
现状:127,
信号:空,
输出:[null,null,null],
pid:25469,
stdout:null,
stderr:null
}

项目运行,但断点被忽略,因此调试器无法工作,我缺少什么?

看起来好像
节点
不在
$PATH
上;你在用什么操作系统?如果你从终端开始构思,这个问题还会持续吗?请注意,不支持将
ts node
用作node.js解释器。您必须指定node.js的有效路径,将
--require ts node/register
作为节点参数传递谢谢,是的,我已经使用node--require ts node/register而不是ts node解决了这个问题。调试器现在工作正常。看起来
节点
不在
$PATH
上;你在用什么操作系统?如果你从终端开始构思,这个问题还会持续吗?请注意,不支持将
ts node
用作node.js解释器。您必须指定node.js的有效路径,将
--require ts node/register
作为节点参数传递谢谢,是的,我已经使用node--require ts node/register而不是ts node解决了这个问题。调试器现在运行良好。