简体   繁体   English

VSCode 不会自动完成 Node.JS 模块

[英]VSCode does not autocomplete Node.JS modules

That's how it works with default js methods, IntelliSense seems to understand and autocomplete this这就是它与默认 js 方法一起工作的方式,IntelliSense 似乎理解并自动完成这个
在此处输入图片说明




And when I'm trying to import some node default modules (path,fs,http) This highlighting does not show methods of these objects, how can I fix this?当我尝试导入一些节点默认模块(path、fs、http)时,此突出显示未显示这些对象的方法,我该如何解决? 在此处输入图片说明

If you have tsconfig.json for some reason, add enableAutoDiscovery to true, as it default to false if that file exists.如果由于某种原因您有tsconfig.json ,请将enableAutoDiscovery添加为 true,因为如果该文件存在,则默认为 false。

// tsconfig.json
{
    ...
    "typingOptions": {
      "enableAutoDiscovery": true
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM