Error: cannot find module objects / lib / decode _codepoint.js'

I am using cheerio module for web scraping. This requires the htmlparser2 module after installing htmlparser2. he gives the following error -

Error: Cannot find module 'entities/lib/decode_codepoint.js' 
+5
source share
2 answers

Use this in a terminal:

 npm install grunt-contrib-jshint --save-dev 

Seen here:

https://www.npmjs.com/package/grunt-contrib-jshint

+2
source

The following applies only to the Windows environment, not to Linux.

I got the same error when I tried to create jquery from a source on Windows. It turns out that jsdom and / or grunt-contrib-jshint (both of which depend on htmlparser2) require gyp and for gyp you need a C ++ compiler and python to work with you. I thought I had them, but it turned out that python should be version 2.x, not version 3.x. If it is 3.x, it gives the correct error on the first start (which I missed), and on subsequent launches you get an error in the question above, which makes you wonder what is happening.

So, I removed python 3.x, installed python 2.x (do not forget to make sure python.exe is in your path), and then deleted the node_modules folder in the root of the project and ran the build again.

This time it worked. I am not sure if this solves the issue of OP, but I hope this helps someone.

0
source

Source: https://habr.com/ru/post/1200004/


All Articles