之前都是使用webstorm中的nodejs模版来建立的nodejs项目,这次想要更好的理解nodejs,打算从一个空白的项目一步一步的建立。
一开始就遇到了问题,在建立一个基本的服务器时,调用nodejs内部的http模块,始终在报错“nodejs core module not configed'上午查了好多资料,最后还是在一篇英文文档中找到答案。
To enable code assistance for Node.js core APIs (and that means you’ll get smart code completion, parameter info and navigation to source code), the only thing you need to do is go to Preferences | Languages & Frameworks | Node.js and npm and click Enable under Code Assistance.
其实就是在设置中启用nodejs,具体路径如上。文档中还提到了很多方法。
https://blog.jetbrains.com/webstorm/2015/11/node-js-coding-assistance-in-webstorm-11/