import JavaScript module in angular nx project

I have an angular project built with nx I want to import standard JavaScript libraries … Read more import JavaScript module in angular nx project

I have an angular project built with nx I want to import standard JavaScript libraries which do not have typescript typings for example I want to install and use cytoscape and cytoscape-context-menus

I get compilation errors such as

error TS7016: Could not find a declaration file for module
‘cytoscape-context-menus’.
‘C:/dev/armo/armo-ng-app/node_modules/cytoscape-context-menus/cytoscape-context-menus.js’
implicitly has an ‘any’ type. Try npm i --save-dev @types/cytoscape-context-menus if it exists or add a new declaration
(.d.ts) file containing declare module 'cytoscape-context-menus';

How can I solve them? I tried to put declaration files but I think my setup doesn’t see them.

Source: JavaSript – Stack Overflow



Leave a Reply

Your email address will not be published. Required fields are marked *