Webstorm无法识别Windows和Ubuntu上的节点Express

环境:

正如下图所示,在创build“Node.js Express App”的平台上,Webstorm只能findNodenpm ,但不能识别Express 。 当然Express是全球安装的,我可以通过terminal上的Express express-generator创build一个Express项目。

 ➜ ~ npm -g list -depth=0 /usr/local/lib ├── bower@1.4.1 ├── cheerio@0.19.0 ├── express@4.13.0 ├── express-generator@4.12.4 ├── npm@2.11.2 └── nrm@0.2.5 

在这里输入图像说明

idea.log如下,不是详细消息:

 [ 0] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ [ 93] INFO - #com.intellij.idea.Main - IDE: WebStorm (build #WS-141.1550, 12 Jun 2015 00:00) [ 93] INFO - #com.intellij.idea.Main - OS: Windows 8 (6.2, x86) [ 93] INFO - #com.intellij.idea.Main - JRE: 1.8.0_40-b26 (Oracle Corporation) [ 93] INFO - #com.intellij.idea.Main - JVM: 25.40-b25 (Java HotSpot(TM) Server VM) [ 109] INFO - #com.intellij.idea.Main - JVM Args: -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=150m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djb.vmOptions=D:\WebStorm 10.0.4\bin\WebStorm.exe.vmoptions -Xbootclasspath/a:D:\WebStorm 10.0.4\lib\boot.jar -Didea.platform.prefix=WebStorm -Didea.no.jre.check=true -Didea.paths.selector=WebStorm10 [ 281] INFO - #com.intellij.idea.Main - JNA library loaded (32-bit) in 172 ms [ 296] INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational [ 328] INFO - #com.intellij.idea.Main - Using "FocusKiller" library to prevent focus stealing. [ 1920] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor js-nashorn-support.xml [ 3094] INFO - llij.ide.plugins.PluginManager - 48 plugins initialized in 1909 ms [ 3110] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: ASP (0.1), AngularJS (141.1550), CSS Support, CVS Integration (11), CoffeeScript (2.0), Cucumber.js (141.1550), Dart (141.1550), EJS (141.1550), EditorConfig (1.0), File Watchers (141.1550), Gherkin (999.999), Git Integration (8.1), GitHub, HAML, HTML Tools (2.0), Handlebars/Mustache (141.1550), IDEA CORE, IntelliLang (8.0), JSTestDriver Plugin (141.1550), Jade (141.1550), Java Server Pages Integration (1.0), JavaScript Debugger (1.0), JavaScript Intention Power Pack (0.9.4), JavaScript Support (1.0), Karma (141.1550), LESS support, LiveEdit (999.0), Meteor (141.1550), NodeJS (141.1550), Perforce Integration (2.0), PhoneGap/Cordova Plugin (141.1550), Polymer & Web Components (141.1550), QuirksMode, REST Client, Refactor-X (2.01), Remote Hosts Access (0.1), SASS support, Spy-js (141.1550), Stylus support (141.1550), Subversion Integration (1.1), Task Management (1.0), Terminal (0.1), TextMate bundles support (VERSION), W3C Validators (2.0), XPathView + XSLT Support (4), XSLT-Debugger (1.4), YAML, hg4idea (10.0) [ 4391] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=200; buffer=10; max=498008064 [ 4469] INFO - api.vfs.impl.local.FileWatcher - Starting file watcher: D:\WebStorm 10.0.4\bin\fsnotifier.exe [ 4516] INFO - api.vfs.impl.local.FileWatcher - Native file watcher is operational. [ 5474] INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: [] [ 6709] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63343 [ 8931] INFO - pl.stores.ApplicationStoreImpl - 77 application components initialized in 5758 ms [ 8965] INFO - .intellij.idea.IdeaApplication - App initialization took 10956 ms [ 9614] INFO - ellij.project.impl.ProjectImpl - 16 project components initialized in 258 ms [ 9614] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms [ 17941] INFO - odejs.packages.NodePackageUtil - Loading node package info for express-generator ... [ 20427] INFO - odejs.packages.NodePackageUtil - Info for express-generator node package loaded successfully in 2478.9 ms [ 21655] INFO - odejs.packages.NodePackageUtil - Loading node package info for express-generator ... [ 22243] INFO - odejs.packages.NodePackageUtil - Info for express-generator node package loaded successfully in 577.0 ms 

Ubuntu和Windows都出现这个问题。
感谢您的帮助!


更新:
正如下面所示,我使用nrm来select最快的npm镜像 – 淘宝网, Webstorm出错了。 当改回npm' main repository, Webstorm can fetch express-generator的信息,而且一切正常。 奇怪!

 C:\Users\honghe>nrm ls npm ---- https://registry.npmjs.org/ cnpm --- http://r.cnpmjs.org/ * taobao - http://registry.npm.taobao.org/ edunpm - http://registry.enpmjs.org/ eu ----- http://registry.npmjs.eu/ au ----- http://registry.npmjs.org.au/ sl ----- http://npm.strongloop.com/ nj ----- https://registry.nodejitsu.com/ pt ----- http://registry.npmjs.pt/ C:\Users\honghe>nrm test npm ---- 1646ms cnpm --- 1275ms * taobao - 4388ms edunpm - 994ms eu ----- 2422ms au ----- 1040ms sl ----- 1369ms nj ----- 2176ms pt ----- Fetch Error 

最初,WebStorm在临时目录中安装指定版本的express-generator软件包。 然后WebStorm使用它来生成一个新的Express项目。 WebStorm不使用已经安装的expressexpress-generator软件包。

顺便说一下, express-generator总是将express包本地安装到一个新的项目中,所以已经安装的express包无法重复使用。

根据截图,问题是Version: Unavailableexpress-generator版本)。 原因应该在CSS对话框的底部指定。 不知道,但可能是因为缺乏互联网连接。 更详细的错误描述可以在idea.log中找到(在主菜单“帮助|显示登录资源管理器”)。