[英]Typescript, "process" does not exist
I installed npm i @types/node
but process still doesn't register as existing.我安装了
npm i @types/node
但进程仍然没有注册为现有的。 What else do I need to do to have type definitions for node?我还需要做什么才能拥有节点的类型定义?
You not only have to install the types for node (ie npm i @types/node
), but you also have to list "node" under "types" in tsconfig.json您不仅必须安装节点的类型(即
npm i @types/node
),而且还必须在 tsconfig.json 的“类型”下列出“节点”
// example tsconfig.json
{
"compilerOptions": {
"module": "CommonJS",
"target": "ES2018",
"baseUrl": ".",
"importHelpers": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"types": ["node"]
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.