最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - VSCode does not autocomplete Node.JS modules - Stack Overflow

programmeradmin0浏览0评论

That's how it works with default js methods, IntelliSense seems to understand and autoplete this




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?

That's how it works with default js methods, IntelliSense seems to understand and autoplete this




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?

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Jan 8, 2018 at 12:38 Sergei BynasSergei Bynas 711 silver badge4 bronze badges 4
  • Probably not of any help, but on my machine the snippet from your last screenshot just works and gives me intellisense for the path namespace... – user3297291 Commented Jan 8, 2018 at 12:44
  • Please mention vs code version – Manjeet Singh Commented Jan 8, 2018 at 13:12
  • did you install the packages ? make sure node_modules exist, run npm install – I Putu Yoga Permana Commented Jan 9, 2018 at 9:06
  • Do you have node and npm installed? VS Code uses npm to automatically download the types that power intellisense. See this section of the docs for mode info – Matt Bierner Commented Jul 6, 2018 at 6:57
Add a ment  | 

1 Answer 1

Reset to default 6

If you have tsconfig.json for some reason, add enableAutoDiscovery to true, as it default to false if that file exists.

// tsconfig.json
{
    ...
    "typingOptions": {
      "enableAutoDiscovery": true
    }
}
发布评论

评论列表(0)

  1. 暂无评论