This error message is indicating that your code is trying to import a module called 'highlight.js', but it cannot find it. This could be because:

  1. You have not installed the 'highlight.js' package. You can install it by running npm install highlight.js in your project directory.

  2. You have installed the 'highlight.js' package, but you have not added it to your project's dependencies in the package.json file. You can add it by running npm install highlight.js --save in your project directory.

  3. Your import statement may be incorrect. Make sure that you are importing the 'highlight.js' module correctly, and that the path to the module is correct.

  4. If you are using TypeScript, you may also need to install the corresponding type declarations for 'highlight.js'. You can do this by running npm install @types/highlight.js in your project directory.

Once you have resolved the issue, the error should go away and you should be able to use the 'highlight.js' module in your code.

TS2307 Cannot find module highlightjs or its corresponding type declarations

原文地址: https://www.cveoy.top/t/topic/byeu 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录