Cannot find package 'stream'

See original GitHub issue

Describe the bug

This happens after the latest update for kit. I got the following error with npm run build:

19:39:57.691 > Cannot find package ‘stream’ imported from /vercel/path0/web/.svelte-kit/output/server/app.js
19:39:57.691 Error [ERR_MODULE_NOT_FOUND]: Cannot find package ‘stream’ imported from /vercel/path0/web/.svelte-kit/output/server/app.js
19:39:57.691 at packageResolve (internal/modules/esm/resolve.js:664:9)
19:39:57.691 at moduleResolve (internal/modules/esm/resolve.js:705:18)
19:39:57.691 at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:819:11)
19:39:57.691 at Loader.resolve (internal/modules/esm/loader.js:89:40)
19:39:57.691 at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
19:39:57.691 at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:73:40)
19:39:57.691 at link (internal/modules/esm/module_job.js:72:36)

Reproduction

Clone my repo here: https://github.com/winston0410/portfolio-2021

cd ./web npm install npm run build

Logs

No response

System Info

System:
    OS: macOS 11.4
    CPU: (8) x64 Apple M1
    Memory: 27.66 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.4.1 - /nix/store/i0sl2paxrjshqn5ps24pdhdkql07x6ra-nodejs-16.4.1/bin/node
    npm: 7.18.1 - /nix/store/i0sl2paxrjshqn5ps24pdhdkql07x6ra-nodejs-16.4.1/bin/npm
  Browsers:
    Brave Browser: 93.1.29.76
    Safari: 14.1.1
  npmPackages:
    @sveltejs/adapter-static: next => 1.0.0-next.18
    @sveltejs/adapter-vercel: next => 1.0.0-next.28
    @sveltejs/app-utils: next => 1.0.0-next.3
    @sveltejs/kit: next => 1.0.0-next.162
    svelte: ^3.34.0 => 3.42.4

Severity

blocking all usage of SvelteKit

Additional Information

I got the same error on both local and vercel.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
jckrcommented, Jul 7, 2022

fwiw, i had a similar error message while accidentally using an old version of node. if you find this page by googling "Cannot find package ‘stream’ " with sveltekit, that’s something you may want to check.

1reaction
benmccanncommented, Jul 22, 2022

Using multiple node versions is easy with nvm: https://github.com/nvm-sh/nvm

Read more comments on GitHub >

github_iconTop Results From Across the Web

2 Answers - 2 - Stack Overflow
How do I resolve "Cannot find module" error using Node.js? 696 · How to use executables from a package installed locally in node_modules?...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >
Error [ERR_MODULE_NOT_FOUND]: Cannot find module in JS
The "Error [ERR_MODULE_NOT_FOUND]: Cannot find module" occurs when you set the type attribute to module in your package.json file, but omit the file ......
Read more >
stream-consumers - npm
a user-land copy of the node:stream/consumers library from Node.js. Latest version: 1.0.2, last published: a year ago.
Read more >
Chapter 6. Managing versions of Application Stream content
In this case, use the --allowerasing option to remove such packages because they cannot be installed together with the later stream due to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found