emscripten-core / emscripten-core/emscripten
Cannot find module 'acorn' compilation error
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I'm trying to compile the `calculate_primes.cpp` file found here: https://github.com/cggallant/WebAssembly-in-Action/tree/master/updated-code/Chapter%209/9.4%20pthreads/source
The command line I'm using is: `emcc calculate_primes.cpp -O1 -std=c++11 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -o pthreads.html`
As of Emscripten 2.0.12, I'm getting the following compilation error:
```
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module 'acorn'
Require stack:
- D:\emsdk-master\emsdk-master\upstream\emscripten\tools\acorn-optimizer.js
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:842:27)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:1026:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:72:18)←[39m
at Object. (D:\emsdk-master\emsdk-master\upstream\emscripten\tools\acorn-optimizer.js:1:13)
←[90m at Module._compile (internal/modules/cjs/loader.js:1138:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:986:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:879:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: [
←[32m'D:\\emsdk-master\\emsdk-master\\upstream\\emscripten\\tools\\acorn-optimizer.js'←[39m
]
}
emcc: error: 'D:/emsdk-master/emsdk-master/node/12.18.1_64bit/bin/node.exe D:\emsdk-master\emsdk-master\upstream\emscripten\tools\acorn-optimizer.js "D:\Gs Stuff\Blog Posts\WebAssembly-in-Action\updated-code\Chapter 9\9.4 pthreads\source\pthreads.worker.js" minifyWhitespace' failed (1)
```
Update... Just in case it was fixed, I tested with 2.0.13 and the same error is there too.
Contributor guide
Assessment
This issue has not been assessed yet.