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.

Cannot find module: avif_node_enc_mt.worker-be931951.js [Windows]

See original GitHub issue

Describe the bug I wanted to try running cli on Win10 but I got error:

PS C:\Users\konta> squoosh-cli --avif "{speed:5,cqLevel:18,subsample:2}" Q:\test.jpg
0/1 ⠦ ▐▨▨▨▨▨╌╌╌╌╌▌ Encoding (8 threads)
 Q:\test.jpg: 258.25KB
node:internal/event_target:646
  process.nextTick(() => { throw err; });
                           ^
Error: Cannot find module 'C:\C:\Users\konta\AppData\Roaming\npm\node_modules\@squoosh\cli\node_modules\@squoosh\lib\build\avif_node_enc_mt.worker-be931951.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at MessagePort.<anonymous> (node:internal/main/worker_thread:187:24)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:460:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
Emitted 'error' event on Worker instance at:
    at Worker.[kOnErrorMessage] (node:internal/worker:298:10)
    at Worker.[kOnMessage] (node:internal/worker:309:37)
    at MessagePort.<anonymous> (node:internal/worker:210:57)
    at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:460:20)
    at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I did try to run npm i -g @squoosh/cli@latest and npx @squoosh/cli. In both cases the result was the same.

Version:

  • OS w/ version: Win10 Pro
  • Node version: v16.6.2
  • npm version: 7.20.5

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
Th3S4mur41commented, Sep 13, 2021

@surma is there already a plan to release a new cli version with this patch?

2reactions
jcao219commented, Aug 12, 2021

Interesting bug! I’m able to reproduce this on Windows 10 also. The same line works on WSL. I’ll look deeper into it tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Nodejs cannot find installed module on Windows
Jade is installed in directory "C:\Program Files (x86)\nodejs\node_modules" , but the following code will fail with a "Cannot find module 'jade'" error, var ......
Read more >
Error: Cannot find module 'node-windows' · Issue #57
I followed the instructions for installing via npm, but when I try and run anything I just get the following error: module.js:340 throw...
Read more >
Error: cannot find module [Node npm Error Solved]
In this article, I'm going to show you how to fix the error. Why the "Error: cannot find module" Occurs. This error occurs...
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
How do I build a Lambda deployment package for Node.js?
I created an AWS Lambda function in Node.js, but I get a "Cannot find module" error during invocation. How do I build my...
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