d.ts typings with multiply modules which i can't require('...')
In my d.ts file under node_modules/ there a multiply "declare module '...'" strings. How can i access to those modules through require('...')? Webstorm is saying "Module is not installed".
Please sign in to leave a comment.
what modules do you use namely? Can you share a sample project that can be used to recreate the issue?
The most is explained here: https://github.com/SinusBot/scripting-docs#intellisense
The tutorial is for Visual Studio Code, and it works there without any problems. Actually, I only use the JetBrains tools, so I wanted to do that for Webstorm.
If you want to get the module for testing:
Do: npm i sinusbot-scripting-engine [or] yarn add sinusbot-scripting-engine.
{"compilerOptions": {
"checkJs": true,
"target": "es2018"
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
My package-lock.json
{"requires": true,
"lockfileVersion": 1,
"dependencies": {
"sinusbot-scripting-engine": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/sinusbot-scripting-engine/-/sinusbot-scripting-engine-1.0.10.tgz",
"integrity": "sha512-uCE+d2z8XVaa/46tq84MuMCB9sM3z6pH3cEVajzmyOZZ/mtKwgEpDEm0ZUxb2dlc6pv8FjUorFcWrVEv2en1MQ=="
}
}
}
My Problem is exactly this one: Webstorms says "engine" is not installed, but it is. Namely in the types.d.ts file.
I see, thanks for update.
WebStorm does use d.ts definitions for javascript types resolving/completion:
but, when loading a module with require('module'), it will still show warnings unless you have a module with specified name in your node_modules.
Thank you for your answer.
Now i have some empty folders in /node_modues, each with the name of a 'required' module. Now i have no warnings anymore. Thank you. I do not understand why this is necessary for Webstorm and not for Visual Studio Code.