Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web_client error: cannot find module 'canvas' #125

Closed
nodingneu opened this issue Jan 24, 2021 · 2 comments
Closed

web_client error: cannot find module 'canvas' #125

nodingneu opened this issue Jan 24, 2021 · 2 comments

Comments

@nodingneu
Copy link

The first step of setting up the web_client example, npm install, fails with:

npm ERR! code 1
npm ERR! path ../../../prismarine-viewer
npm ERR! command failed
npm ERR! command sh -c node viewer/prerender.js && webpack
npm ERR! node:internal/modules/cjs/loader:922
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module 'canvas'
npm ERR! Require stack:
npm ERR! - ../../../prismarine-viewer/viewer/lib/atlas.js
npm ERR! - ../../../prismarine-viewer/viewer/prerender.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:763:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:991:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:92:18)
npm ERR!     at Object.<anonymous> (../../../prismarine-viewer/viewer/lib/atlas.js:2:27)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1102:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:967:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:807:14)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:991:19) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '../../../prismarine-viewer/viewer/lib/atlas.js',
npm ERR!     '../../../prismarine-viewer/viewer/prerender.js'
npm ERR!   ]
npm ERR! }

Subsequent npm installs or npm run build-start (even after e.g. my first guess npm install --save canvas) seem to error with

ERROR in ../../../asap/asap.js 64:11-18
Module not found: Error: Can't resolve 'process/browser' in '../../../asap'
 @ ../../../promise/index.js 6:11-26
 @ ../../../event-promise/index.js 1:14-32
 @ ../../../prismarine-world/src/world.js 4:13-37
 @ ../../../prismarine-world/index.js 1:0-42
 @ ../../viewer/lib/worldView.js 3:28-65
 @ ../../viewer/index.js 3:13-49
 @ ./index.js 7:30-65
@extremeheat
Copy link
Member

Remove the "prismarine-viewer": "file:../..", in the package.json and do npm install prismarine-viewer

@nodingneu
Copy link
Author

nodingneu commented Jan 24, 2021

Thanks, it's running now, but it always times out #126

@Karang Karang closed this as completed Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants