如何配置 WebStorm 识别现有项目中的节点,错误:unresolved function require [英] How to configure WebStorm to recognize node in an existing project, error: unresolved function require
问题描述
我有一个在 WebStorm 中打开的现有项目,但它无法识别 node.js 全局变量.我看到一个帖子说转到首选项并将 Node.js 全局变量添加到库中,但在我最新的 WebStorm 11 中没有看到.),我在其库首选项中没有看到 node.js 全局变量 - 所以我不确定这是否是解决方案.
I have an existing project that I've opened in WebStorm and it's not recognizing node.js globals. I saw a post saying go to preferences and add Node.js globals to the libraries but I don't see that in my latest WebStorm 11. Looking at another project that does work (created by using the new node.js app command in WebStorm), I don't see the node.js globals in its library preferences- so I'm not sure if that is the solution.
如果我通过 WebStorm 创建一个新项目,指定一个 node.js 项目,它工作正常,但如何配置现有项目?
It works fine if I create a new project through WebStorm specifying a node.js project, but how do I configure an existing project?
推荐答案
Found the asnwer -> Preferences - Languages &框架 - Node.js 和 NPM - 启用代码辅助:节点核心库.
Found the asnwer -> Preferences - Languages & Frameworks - Node.js and NPM - enable Code Assistance: Node Core library.
这篇关于如何配置 WebStorm 识别现有项目中的节点,错误:unresolved function require的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!