我的文件是:

问题描述 投票:0回答:5
Tsconfig.json

{ "compilerOptions": { "declaration": true, "target": "es2017", "module": "commonjs", "esModuleInterop": true, "outDir": "dist", "sourceMap": true, "skipLibCheck": true, "typeRoots": ["node_modules/@types", "./typings", "node_modules/**/*.d.ts"], "lib": ["esnext"] }, "include": ["src/**/*.ts", "./typings/**/*.d.ts"], "exclude": ["node_modules/**", "dist"] }

当我进行任何更改时,我会得到一个小弹出窗口,但实际上并不重新启动服务器,不确定我在这里做错了什么。
注:我第一次在手动重新启动后进行更改后,它向我显示了一个弹出窗口,类似终端中的东西
[INFO] 22:07:09 Restarting: src/analytics-engine.ts has been modified

之后没有更改检测。

现在解决了问题。我发现了使用

--debug

的问题,这是与“ sigterm”相关的错误。因此,我在

--exit-child

脚本中添加了一个标志。
    

node.js typescript nodemon tsc ts-node
5个回答
39
投票
npm start

也为我工作。

示例
--exit-child

package.json


22
投票
当服务器启动时,有一些登录服务器初始化进程。当Dev Server通过TS-Node-Dev重新启动时,有时它会吐出错误,从我假设重新启动的服务器试图写入旧流。

flag似乎已解决了问题

    

您可以尝试将

-respawn

-

-在您的软件包中flags。
示例:

3
投票

其他人现在也有这个问题,添加

write: EPIPE
,为我工作

--exit-child

    

您可以在索引文件中对其进行处理:

2
投票
这条线: process.on(“ sigterm”,拆卸);

{ "scripts": { "start:dev": "tsnd --respawn --inspect --transpile-only --ignore-watch node_modules src/server" } }


0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.