[英]Everytime I try to deploy functions I get "Cannot find type definition file for ..."
I am tired of seeing these errors, they are preventing me from deploying my code, what do they mean?我厌倦了看到这些错误,它们阻止我部署我的代码,它们是什么意思?
Currently I have this error:目前我有这个错误:
error TS2688: Cannot find type definition file for 'linkifyjs 2'.
error TS2688: Cannot find type definition file for 'node 2'.
I am not even using linkifyjs 2
in my code, so for what reason do I have to deal with the error that is associated with it?我什至没有在我的代码中使用
linkifyjs 2
,那么出于什么原因我必须处理与之相关的错误呢?
this is my tsconfig:这是我的 tsconfig:
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": ["src"]
}
Can someone explain the origin of these errors and how can I avoid them?有人可以解释这些错误的起源以及如何避免它们吗?
I am also facing this issue.我也面临这个问题。 In this way, I resolved this issue.
通过这种方式,我解决了这个问题。
The first thing you need to do is make sure you have typings for Node.js installed.您需要做的第一件事是确保您安装了 Node.js 的类型。 Open your terminal in the root directory of your project and run the following command.
在项目的根目录中打开终端并运行以下命令。
npm i -D @types/node
If the error is still not resolved, try restarting your IDE.如果错误仍未解决,请尝试重新启动 IDE。
If that doesn't help, make sure the types array in your tsconfig.json file contains "node".如果这没有帮助,请确保 tsconfig.json 文件中的类型数组包含“节点”。
{
"compilerOptions": {
"types": [
// ... your other types
"node"
],
},
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.