gpt4 book ai didi

javascript - Atom typescript 插件找不到名称 'describe'

转载 作者:数据小太阳 更新时间:2023-10-29 03:55:32 28 4
gpt4 key购买 nike

我已经尝试包含一行输入,但这并没有为我解决这个问题

enter image description here

这是我的 tsconfig.json 文件:

{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
],
"types": [
"jasmine"
]
}
}

node_modules 的路径是正确的

最佳答案

我正在使用这个临时解决方案 - 同时我希望 atom-typescript 插件可以更好地解决它。

安装类型;

npm install @types/jasmine --save-dev

将这一行添加到我的 src/app/app.component.spec.ts 文件中;

import  '../../node_modules/@types/jasmine';

不需要将它添加到任何其他规范文件中,只需编辑这个文件即可解决我的问题。

我发现的另一种变通方法有效,但对我来说不如上面那样好,因此根据您的需要编辑“package.json”,方法是将“devDependencies”中的 jasmine 引用移至“dependencies” "部分;

"@types/jasmine": "^2.5.38"

关于javascript - Atom typescript 插件找不到名称 'describe',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40303942/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com