Node.js typescript错误-找不到名称';过程';
我正在使用express+typescript设置一个新项目,并且面临typescript错误-找不到名称“processs” package.jsonNode.js typescript错误-找不到名称';过程';,node.js,typescript,express,Node.js,Typescript,Express,我正在使用express+typescript设置一个新项目,并且面临typescript错误-找不到名称“processs” package.json "dependencies": { "express": "^4.16.4", "nodemon": "^1.18.7", "tsc": "^1.20150623.0", "typescript": "^3.1.6" }, "devDependencies": { "@types/express"
"dependencies": {
"express": "^4.16.4",
"nodemon": "^1.18.7",
"tsc": "^1.20150623.0",
"typescript": "^3.1.6"
},
"devDependencies": {
"@types/express": "^4.16.0",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.10",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-promise": "^4.0.1",
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"typescript-eslint-parser": "^21.0.1"
}
我试着按照这些规则添加类型
tsconfig
但我仍然得到了错误。我已经安装了npm(6.4.1)和node(8.14.0),开始构建我的新项目。有人能指出我做错了什么吗?您的新配置看起来不错。不过,如果typescript语言服务器仍然使用以前版本的tsconfig,则可能必须重新启动该服务器。要在VS代码中执行此操作,请执行
Ctrl+Shift+P
和Reload Window
或TypeScript:重新启动TS服务器
(如果可用)
此外,您的依赖项中不需要tsc
包,因为它现在已被弃用,而且typescript
包附带tsc
可执行文件
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist",
"sourceMap": true,
"types": ["node"] -----
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}