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".

0
4 comments

what modules do you use namely? Can you share a sample project that can be used to recreate the issue?

0
Avatar
Permanently deleted user
Thank you for wanting to help me!

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.
 
This link is for 7 days valid.
 
My modules are only sinusbot-scripting-engine.
 
My jsconfig.json:
{
"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.

0

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.

1
Avatar
Permanently deleted user

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.

0

Please sign in to leave a comment.