简体   繁体   English

输入toPromise和WebStorm时出错

[英]Error on typings for toPromise and WebStorm

WebStorm does not seem to be recognising the typings for the toPromise function on 'rxjs'. WebStorm似乎无法识别'rxjs'上toPromise函数的类型。 Is this anything I can fix? 这是我能解决的吗? I have updated it. 我已经更新了。

However it does work when I run the code. 但是,当我运行代码时它确实起作用。 Which is weird. 这很奇怪。

在此处输入图片说明

Ok so got this working in the end. 好的,这样最终就可以了。 My process was 我的过程是

  1. Delete npm globals folder @ 'usr/local/lib/node_modules' 删除npm globals文件夹@'usr / local / lib / node_modules'
  2. Re-install node and npm 重新安装节点和npm
  3. Delete all my local node_modules 删除我所有的本地node_modules
  4. npm cache clear npm缓存清除
  5. restart webstorm 重新启动网络风暴

Now it magically picked up the type def. 现在,它神奇地拾取了def类型。 I would say generally I just had to clear out as much as possible and get it all rebuild. 我会说一般来说,我只需要尽可能多地清理并重新构建它们。

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

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