[英]Everytime I try to deploy functions I get "Cannot find type definition file for ..."
我厌倦了看到这些错误,它们阻止我部署我的代码,它们是什么意思?
目前我有这个错误:
error TS2688: Cannot find type definition file for 'linkifyjs 2'.
error TS2688: Cannot find type definition file for 'node 2'.
我什至没有在我的代码中使用linkifyjs 2
,那么出于什么原因我必须处理与之相关的错误呢?
这是我的 tsconfig:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": ["src"]
}
有人可以解释这些错误的起源以及如何避免它们吗?
我也面临这个问题。 通过这种方式,我解决了这个问题。
您需要做的第一件事是确保您安装了 Node.js 的类型。 在项目的根目录中打开终端并运行以下命令。
npm i -D @types/node
如果错误仍未解决,请尝试重新启动 IDE。
如果这没有帮助,请确保 tsconfig.json 文件中的类型数组包含“节点”。
{
"compilerOptions": {
"types": [
// ... your other types
"node"
],
},
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.