简体   繁体   English

WebStorm 2016.3.2“缺少导入声明”

[英]WebStorm 2016.3.2 “Missing import statement”

So I have WebStorm javascript project powered by Systemjs and JSPM . 所以我有由Systemjs and JSPM支持的Systemjs and JSPM javascript项目。 Little annoying thing is that Webstorm can't see global System object, so marks it as Missing import statement in the config.js file. 令人讨厌的一点是,Webstorm无法看到全局System对象,因此在config.js文件中将其标记为Missing import语句

I followed a tip: 我遵循提示:

When using libraries that define their own global symbols outside 
their visible JavaScript code (e.g. describe() in Mocha), it is   
recommended that you add the corresponding TypeScript type definition 
file as a JavaScript library in Preferences | Languages & Frameworks | 
JavaScript | Libraries.

And added system.js file from jspm_packages to the Javascript libraries in the Webstorm settings of my project. 并补充system.jsjspm_packages在我的项目的Webstorm设置JavaScript库文件。

在此处输入图片说明

But it didn't help. 但这没有帮助。 Any idea what I am missing? 知道我缺少什么吗?

This worked for me. 这对我有用。

  1. Select the mocha library in the list 在列表中选择Mocha库
  2. Click the "Download ..." button on the right side. 单击右侧的“下载...”按钮。
  3. Search for mocha 搜索摩卡
  4. Click the "Download and Install" button. 点击“下载并安装”按钮。

Download Library window 下载库窗口

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

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