question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[PackFileCacheStrategy error because of 'fsevents' on windows

See original GitHub issue

Bug report

What is the current behavior?

[webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Can't resolve 'fsevents' in '<path>\node_modules\chokidar'
 while resolving 'fsevents' in <path>\node_modules\chokidar to a directory

I tried installing fsevents as a dev dependency, but it says:

Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

It’s also skipped when chokidar is installed, I assume that fsevents is not available on windows.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

caching works and no error

Other relevant information: webpack version: 5 Node.js version: v14.15.1 Operating System: Windows 7 Additional tools: Webpack is used in NextJS

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sokracommented, Apr 2, 2021

This is a webpack bug. We need to make optional dependencies optional

1reaction
alexander-akaitcommented, Apr 2, 2021

I think you need to open an issue in nextjs repo

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm install fails in windows using fsevents #17671 - GitHub
I'm opening this issue because: npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand.
Read more >
error fsevents@1.0.14 in windows 7 - node.js - Stack Overflow
Actually, the problem here is the HTTP fetch. Try using npm install --no-optional. It will work.You can read more about this here.
Read more >
Azure Pipelines - node.js build on Windows doesn't complete ...
It's a warning, not an error. It occurs because fsevents is an optional dependency, used only when project is run on macOS environment...
Read more >
Cache - webpack
It's recommended to set cache.buildDependencies.config: [__filename] in your webpack configuration to get the latest configuration and all dependencies. webpack ...
Read more >
Problems with npm install after loading project files. - Treehouse
this has been an ongoing occurrence with EVERY project in the REACT series. I am finally asking the question. What is going on?...
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