Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 为什么我在.js文件上有intellisense,但在.ts文件上没有intellisense?_Typescript_Typescript Typings_Typescript2.0 - Fatal编程技术网

Typescript 为什么我在.js文件上有intellisense,但在.ts文件上没有intellisense?

Typescript 为什么我在.js文件上有intellisense,但在.ts文件上没有intellisense?,typescript,typescript-typings,typescript2.0,Typescript,Typescript Typings,Typescript2.0,这是我的package.json: { "name": "edge-node-api", "version": "1.0.0", "description": "Edge Electrons customers web API", "main": "api.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository"

这是我的package.json:

 {
    "name": "edge-node-api",
    "version": "1.0.0",
    "description": "Edge Electrons customers web API",
    "main": "api.js",
    "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
 },
"repository": {
    "type": "git",
    "url": "http://192.168.0.50:3000/lem/edge-node-api.git"
},
"author": "lem",
"license": "ISC",
"dependencies": {
    "body-parser": "^1.17.2",
    "bull": "^3.0.0-alpha.4",
    "del": "^2.2.2",
    "express": "^4.15.3",
    "fm-log": "^4.4.3",
    "lodash": "^4.17.4",
    "memcached": "^2.2.2",
    "moment": "^2.18.1",
    "morgan": "^1.8.2",
    "njwt": "^0.4.0",
    "pg": "^6.2.2",
    "redis": "^2.7.1",
    "vali-date": "^1.0.0"
},
"devDependencies": {
    "@types/bull": "^2.1.0",
    "@types/node": "^7.0.22",
    "api-doc": "^4.0.0",
    "gulp": "^3.9.1",
    "gulp-develop-server": "^0.5.2",
    "gulp-sequence": "^0.4.6",
    "gulp-typescript": "^3.1.7",
    "typescript": "^2.3.3",
    "typings": "^2.1.1"
}
}

这是我的tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es2017",
        "sourceMap": true,
        "removeComments": true,
        "outDir": "dist"
    },
    "include": [
        "src/**/*.ts"
    ],
    "exclude": [
        "node_modules"
    ]
}
这是我的typings.json:

{
    "devDependencies": {
        "body-parser": "registry:npm/body-
            parser#1.15.2+20161116154925",
        "debug": "registry:npm/debug#2.0.0+20170504163145",
        "express": "registry:npm/express#4.14.0+20170217205433",
        "gulp": "registry:npm/gulp#4.0.0-alpha.2+20160817105618",
        "lodash": "registry:npm/lodash#4.0.0+20161015015725",
        "memcached": "registry:dt/memcached#2.2.0+20170324151803",
        "morgan": "registry:dt/morgan#1.7.0+20160726064905",
        "pg": "registry:npm/pg#6.0.2+20170314174547",
        "redis": "registry:npm/redis#2.6.0+20160901110043"
  },
  "dependencies": {},
  "globalDevDependencies": {
      "bull": "registry:dt/bull#2.1.2+20170221033156"
  }
}

我遗漏了什么吗?

我刚删除了

包括:[ src/***.ts ],


来自tsconfig.json,它成功了。

没有示例代码很难知道。此外,如果您使用的是TypeScript 2.0或更高版本,我建议您完全从打字改为只使用@types。