Code Inspection not working probably

Webstorm says there is a typo when I'm using __dirname. How do I solve this?

https://imgur.com/a/E1CR6

0
4 comments
Avatar
Permanently deleted user

I also have a problem with using res.sendFile from express modules.

It says I cant do two arguments "function(err)" however it should accept two arguments as you can see in the modules.

https://imgur.com/a/ju4cp

0

1. hit Alt+Enter on __dirname, then choose to save it to dictionary

2. can't recreate:

do you have express Typescript stubs installed (npm i @types/express)?

0
Avatar
Permanently deleted user

Hi again Elena, doing @types/express worked.

I have another problem with using the module axios now. If i run the app with require('axios') it works. 

However this gives problems with the IDE inspection axios.get() saying "unresolved function" see linked image:

https://imgur.com/a/Vj2pf

Then if i change the require require('@types/axios') the IDE is happy and the "unresolved function" warning is gone. However this makes the app crash when running. See image below:

https://imgur.com/a/8NJDL

How do i resolve this? Thanks.

0

Recreated in 2017.2.4, but seems to work in 2017.3 EAP (https://confluence.jetbrains.com/display/WI/WebStorm+EAP):

Note: no reason for installing @types/axios, axios package comes with index.d.ts preinstalled

1

Please sign in to leave a comment.