0
我有一个test1.ts文件,它只有一行:在vscode中需要json文件有什么区别吗?
var x = require('./temp2.json')
这在VSCode没有报警,但是当我在test2.js类似的代码:
var x = require('./temp2.json')
它触发警告:[js]找不到模块'./temp2.json',为什么? btw checkJs在jsconfig.json中为true
你有没有检查test2.js的相对路径?也许它是在不同的文件夹? –
在同一个文件夹中 – AngeloC
@AngeloC可能只是'temp2.json'而不是'。/ temp2.json'? – ifconfig