Yarn (and npm) Install Taking Excessively Long on First Run; Issues with Other Commands as Well


Hello community,

I hope you're all doing well. I'm currently facing multiple issues with my development environment on a new MacBook Air with an M2 chip. I'm seeking some guidance to understand and resolve these problems.

Issue 1: Yarn Install Duration Problem:

I've noticed that when I run yarn install in my project for the first time, it's taking an unusually long time, exceeding 30 minutes. I understand that the first run may be slower due to downloading and caching dependencies, but this duration seems excessive.

Observations:

  • The project has a reasonable number of dependencies, but nothing extraordinary.
  • I've checked my internet connection, and it seems stable with decent download speeds for other files.
  • I've cleared the Yarn cache and retried the installation, but the issue persists.
  • Disk space is not an issue, and there are no error messages during the installation.

Environment:

  • MacBook Air with M2 chip
  • macOS: latest
  • Node.js version: latest
  • Yarn version: latest
  • NPM version: latest

Steps Taken:

  1. Checked internet connection.
  2. Cleared Yarn cache.
  3. Verified disk space.
  4. Checked for error messages during installation.

Additional Information: I've also tried running the same installation on a different network to rule out connectivity issues.

Issue 2: rm -rf node_modules Slow and Unresponsive:

In addition to the Yarn install problem, I've noticed that even running a simple command like rm -rf node_modules in my project root is extremely slow and may not even be working. This issue seems unrelated to Yarn.

Observations:

  • Memory usage is within normal limits.
  • The MacBook Air is brand new.

Steps Taken:

  1. Checked memory usage.
  2. Ensured sufficient disk space.
  3. Verified that there are no other resource-intensive processes running.

I would appreciate any insights, suggestions, or guidance from the community on what might be causing both the prolonged installation time with Yarn and the slowness with the rm command. Additionally, any tips on how to troubleshoot and resolve these issues would be highly valuable.

Thank you in advance for your assistance!


MacBook Air 15″, macOS 14.0

Posted on Nov 14, 2023 11:04 PM

Reply

Similar questions

2 replies

Nov 15, 2023 7:20 AM in response to jimmyblundell

If you’re really on macOS 14.0 as per the footer here, update macOS to current.

If whatever these tools do involves the command line tools, check for any updates for those, too.

If you’re looking for a generic build tool (and not something specific to npm), have a look at Meson.

And this isn’t the hot-bed of help with third-party frameworks such as npm, if that’s where you’re headed.

As was mentioned above, forums for yarn or npm will probably be a better place for help.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Yarn (and npm) Install Taking Excessively Long on First Run; Issues with Other Commands as Well

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.