`Cannot find module` error for Node-provided package
See original GitHub issue- Do you want to request a feature or report a bug? bug
- What is the current behavior? build fails with error Cannot find module 'stream/package.json'
- If the current behavior is a bug, please provide the steps to reproduce.
- Create a new SvelteKit project with
npm init svelte@next - Install the Netlify adapter: https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify#installation
- Create an
.nvmrcwith the contents16to use Node 16 - Deploy to Netlify
- What is the expected behavior?
There should be no need to install a stream package because it is provided by Node: https://nodejs.org/api/stream.html#stream_stream
I’m not sure why it’s trying to find stream/package.json and failing since this is a built-in package
- Please mention your node.js, and operating system version.
Node 16. Linux
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
I'm getting the error because I'm trying to import the freeCodeCamp icon from the react-icons package, which I don't have installed. import { ......
Read more >How to resolve "Cannot find module" error in Node - Sabe.io
When you are working in Node, you will sometimes encounter the error Cannot find module 'module-name' with the error code MODULE_NOT_FOUND .
Read more >[Solution] Error: Cannot Find Module "nodemailer" - Courier
What's Causing This Error? This error occurs when you have not installed the nodemailer library in your Node.js application.
Read more >Aimesh node disconnecting - Spendy Market
Dec 22, 2021 · ASUS Lyra Trio (2-Pack) AC1750 Dual Band Mesh WiFi System ... In the main router under Network map the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is now working. Existing projects will need to “clear cache and deploy”
Thanks for all the help!!
Did some more digging. This error happens when you’re using zip-it-and-ship-it’s dependency resolution mechanism, which uses the Node’s builtin
process.binding("natives")to get a list of which dependencies are native (likefsorpathorstream/web) and which are not (likereactoris-even). Relying onprocess.binding("natives")means that it depends on whatever Node version is used to do the bundling. Sincestream/web, which is used by your dependencyfetch-blob, is a Node v16 feature, it rightfully fails (aws lambda, and by extension netlify functions, don’t yet support Node v16). What zip-it-and-ship-it doesn’t detect:fetch-blobaccounted for that to happen, and has a fallback strategy. So it fails wrongfully.You can unblock yourselves by using the
esbuildbundler (which I see you already found out via https://github.com/sveltejs/kit/pull/2605). In your case @marovargovcik this has the additional upside of replacing therollupbundling stage altogether, since esbuild does all the things rollup does for you.