highlight.js
highlight.js copied to clipboard
Module not found: Error: Package path ./lib/index is not exported from package /node_modules/highlight.js
I'm using Laravel, When I run npm run dev, it shows this:
ERROR in ./resources/assets/vendor/libs/highlight/highlight.js 4:0-42
Module not found: Error: Package path ./lib/index is not exported from package /home/wwwroot/myproject/node_modules/highlight.js (see exports field in /home/wwwroot/myproject/node_modules/highlight.js/package.json)
I checked /home/wwwroot/myproject/node_modules/highlight.js and there is ./lib/index.js I've changed these in myproject before running npm run dev with root, but nothing changed:
chmod 775 myproject -R
chown www:www -R myproject
We don't export lib/index... if you want the full library (lib/index) you should just import "highlight.js" by name, rather than trying to reference an index file.
Thank you for your response, but why can't my project find ./lib/index? Is there any reason I can check. I'm newer to this npm thing.
Are you trying to use the library server-side with Node or build it for client-side usage?