Codesandbox-client: Error: Could not fetch dependencies

Created on 27 Sep 2020  ·  4Comments  ·  Source: codesandbox/codesandbox-client

🐛 bug report

Preflight Checklist

  • [x] I have read the
    Contributing Guidelines
    for this project.
  • [x] I agree to follow the
    Code of Conduct
    that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

When I added 'x' npm package, it keeps loading. After 1-2 minutes, it shows error as Error: Could not fetch dependencies, please try again in a couple seconds: Something went wrong while packaging the dependency and long list of deprecated packages.

How has this issue affected you? What are you trying to accomplish?

I was trying to show demo of my npm package by using it in sandbox

To Reproduce

Add react-donut as dependency. I tried this approach and it always yielded an error.

Link to sandbox:

https://codesandbox.io/s/hopeful-buck-c401h

Screenshot

chrome-capture (68)

Your Environment

| Software | Name/Version |
| ---------------- | ------------ |
| Сodesandbox |
| Browser | Chrome(85.0.4183.83)
| Operating System | Linux (Ubuntu 18.04)

🎒 Bundler

All 4 comments

Looks like we're running the prepublishOnly step on install. This used be the standard behaviour before npm 4. Going to look into why we're running that.

Update: Scratch that, that ain't it. Looking deeper

Update:

This is what is at the end of the error - ENOSPC: no space left on device, write. Which means the node_modules was bigger than 512MB.

The 512MB limit is a limitation of how we install and package dependencies and definitely not your fault, but making the node_modules smaller would help everyone.

 

Looking at your package.json, I see things that should not be dependencies.

react-scriptsdevDependencies
react, react-dompeerDependencies or devDependencies, based on your package.

I created a new package and moved all 3 of these out of dependencies and it works: https://codesandbox.io/s/relaxed-bush-5kw8z?file=/src/App.js

 

Again, this is based on our limitations, you might have perfectly good reasons to keep those in dependencies. But if not, hopefully this solves the issue 👍

That's the problem, got it. Yeah it totally got out of my mind that those should be in devDependencies instead

Thanks for clear and concise explanation. Now I'll take steps and update my package accordingly.

Also, +1 for creating package and showing that demo

Great, happy to help!

Was this page helpful?
0 / 5 - 0 ratings