Kakulukian / youtube-transcript

Fetch transcript from a youtube video
307 stars 61 forks source link

Ran npm i youtube-transcript but modules not found #7

Closed coderpr0grammer closed 8 months ago

coderpr0grammer commented 1 year ago

I get can't resolve path http https querystring zlib url.

Tried manually installing those packages but i still get the following errors:

ERROR in ./node_modules/centra/model/CentraRequest.js 2:13-28
Module not found: Error: Can't resolve 'http' in 'C:\Users\danie\Documents\GitHub\chrome-extension-boilerplate-react\node_modules\centra\model'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
        - install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "http": false }
 @ ./node_modules/centra/createRequest.js 1:22-57
 @ ./node_modules/phin/lib/phin.js 3:15-32
 @ ./node_modules/youtube-transcript/dist/youtube-transcript.esm.js 1:0-21 99:45-46 107:45-46
 @ ./src/pages/Content/index.jsx 8:0-55 65:2-35

ERROR in ./node_modules/centra/model/CentraRequest.js 3:14-30
Module not found: Error: Can't resolve 'https' in 'C:\Users\danie\Documents\GitHub\chrome-extension-boilerplate-react\node_modules\centra\model'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
        - install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "https": false }
 @ ./node_modules/centra/createRequest.js 1:22-57
 @ ./node_modules/phin/lib/phin.js 3:15-32
 @ ./node_modules/youtube-transcript/dist/youtube-transcript.esm.js 1:0-21 99:45-46 107:45-46
 @ ./src/pages/Content/index.jsx 8:0-55 65:2-35

ERROR in ./node_modules/zlib/lib/zlib.js 1:0-43
Module not found: Error: Can't resolve './zlib_bindings' in 'C:\Users\danie\Documents\GitHub\chrome-extension-boilerplate-react\node_modules\zlib\lib'
 @ ./node_modules/centra/model/CentraRequest.js 5:13-28
 @ ./node_modules/centra/createRequest.js 1:22-57
 @ ./node_modules/phin/lib/phin.js 3:15-32
 @ ./node_modules/youtube-transcript/dist/youtube-transcript.esm.js 1:0-21 99:45-46 107:45-46
 @ ./src/pages/Content/index.jsx 8:0-55 65:2-35

I'm working in React using Webpack in a chrome extension

mikeislearning commented 1 year ago

I get can't resolve path http https querystring zlib url.

Tried manually installing those packages but i still get the following errors:

ERROR in ./node_modules/centra/model/CentraRequest.js 2:13-28
Module not found: Error: Can't resolve 'http' in 'C:\Users\danie\Documents\GitHub\chrome-extension-boilerplate-react\node_modules\centra\model'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
        - install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "http": false }
 @ ./node_modules/centra/createRequest.js 1:22-57
 @ ./node_modules/phin/lib/phin.js 3:15-32
 @ ./node_modules/youtube-transcript/dist/youtube-transcript.esm.js 1:0-21 99:45-46 107:45-46
 @ ./src/pages/Content/index.jsx 8:0-55 65:2-35

ERROR in ./node_modules/centra/model/CentraRequest.js 3:14-30
Module not found: Error: Can't resolve 'https' in 'C:\Users\danie\Documents\GitHub\chrome-extension-boilerplate-react\node_modules\centra\model'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
        - install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "https": false }
 @ ./node_modules/centra/createRequest.js 1:22-57
 @ ./node_modules/phin/lib/phin.js 3:15-32
 @ ./node_modules/youtube-transcript/dist/youtube-transcript.esm.js 1:0-21 99:45-46 107:45-46
 @ ./src/pages/Content/index.jsx 8:0-55 65:2-35

ERROR in ./node_modules/zlib/lib/zlib.js 1:0-43
Module not found: Error: Can't resolve './zlib_bindings' in 'C:\Users\danie\Documents\GitHub\chrome-extension-boilerplate-react\node_modules\zlib\lib'
 @ ./node_modules/centra/model/CentraRequest.js 5:13-28
 @ ./node_modules/centra/createRequest.js 1:22-57
 @ ./node_modules/phin/lib/phin.js 3:15-32
 @ ./node_modules/youtube-transcript/dist/youtube-transcript.esm.js 1:0-21 99:45-46 107:45-46
 @ ./src/pages/Content/index.jsx 8:0-55 65:2-35

I'm working in React using Webpack in a chrome extension

I think this only works on a back end node server, not a front end react app

chiragksharma commented 10 months ago

@mikeislearning I am creating a chrome extension using typescript and this api. Still getting the same error how to set up node server with typescript while creating chrome extension

T1LT commented 9 months ago

@mikeislearning I'm having the same issue in a Next.js API route (which is a node server). Do you have any fixes/suggestions?

Kakulukian commented 8 months ago

Should be fixed by #12