Postprocessing: cannot find module 'fs/promises'

Created on 3 Feb 2021  Β·  2Comments  Β·  Source: vanruesc/postprocessing

Description of the bug

Just trying to build tests/examples of the cloned repo on its own

03 00:28 ~/postprocessing ❯❯❯ rm -rf node_modules && npm i && npm run test

> [email protected] postinstall /home/slu/postprocessing/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall /home/slu/postprocessing/node_modules/eslint-watch/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall /home/slu/postprocessing/node_modules/esbuild
> node install.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 772 packages from 474 contributors and audited 775 packages in 7.226s

76 packages are looking for funding
  run `npm fund` for details

found 3 vulnerabilities (1 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                npm update check failed                β”‚
β”‚          Try running with sudo or get access          β”‚
β”‚         to the local update config store via          β”‚
β”‚ sudo chown -R $USER:$(id -gn $USER) /home/slu/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

> [email protected] test /home/slu/postprocessing
> run-s lint build ava


> [email protected] lint /home/slu/postprocessing
> eslint --ext .js --fix src demo/src


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                npm update check failed                β”‚
β”‚          Try running with sudo or get access          β”‚
β”‚         to the local update config store via          β”‚
β”‚ sudo chown -R $USER:$(id -gn $USER) /home/slu/.config β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

> [email protected] build /home/slu/postprocessing
> run-s build:*


> [email protected] build:js /home/slu/postprocessing
> cross-env NODE_ENV=production ts-node-script esbuild

Error: Cannot find module 'fs/promises'
Require stack:
- /home/slu/postprocessing/node_modules/esbuild-plugin-glsl/dist/esbuild-plugin-glsl.cjs
- /home/slu/postprocessing/esbuild.config.ts
- /home/slu/postprocessing/esbuild.ts
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/slu/postprocessing/node_modules/esbuild-plugin-glsl/dist/esbuild-plugin-glsl.cjs:7:562)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:js: `cross-env NODE_ENV=production ts-node-script esbuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/slu/.npm/_logs/2021-02-03T05_28_34_507Z-debug.log
ERROR: "build:js" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `run-s build:*`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/slu/.npm/_logs/2021-02-03T05_28_34_548Z-debug.log
ERROR: "build" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `run-s lint build ava`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/slu/.npm/_logs/2021-02-03T05_28_34_571Z-debug.log

I will look into why fs/promises is being looked for, and/or what it is.

external bug

Most helpful comment

Thanks for pointing this out!

This was caused by one of the dev tools (esbuild-plugin-glsl) which is now fixed. It should now be possible to build postprocessing on nodeβ‰₯0.10.18 after running npm update.

All 2 comments

I switched to node 14 and this ran fine. This hinted me that node 12 has problems with whatever dependency that tries to require/import promises with that path.

Thanks for pointing this out!

This was caused by one of the dev tools (esbuild-plugin-glsl) which is now fixed. It should now be possible to build postprocessing on nodeβ‰₯0.10.18 after running npm update.

Was this page helpful?
0 / 5 - 0 ratings