Error: Cannot find module 'cheerio' using yt-search and create-react-app

Viewed 348

I'm using create-react-app to create a new projet using typescript. I'm used to the library yt-search working fine in a normal NodeJS environment.

It seems that webpack cannot resolve the "cheerio" module path (required by yt-search) and I'm using the default webpack.config.ts provided by CRA.

What can I do to solve that issue?

Here is the error message from the log console :

Uncaught Error: Cannot find module 'cheerio'
    s yt-search.min.js:1
    s yt-search.min.js:1
    ./node_modules/yt-search/dist/yt-search.min.js/</<[1]< yt-search.min.js:1
    s yt-search.min.js:1
    r yt-search.min.js:1
    js yt-search.min.js:1
    js yt-search.min.js:1
    js yt-search.min.js:1
    Webpack 15
yt-search.min.js:1
0 Answers
Related