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

Can't use if canvas is installed locally #31

Open
Prior99 opened this issue Jul 14, 2020 · 2 comments
Open

Can't use if canvas is installed locally #31

Prior99 opened this issue Jul 14, 2020 · 2 comments

Comments

@Prior99
Copy link
Contributor

Prior99 commented Jul 14, 2020

If canvas is installed by any dependency, the tests in jest-electron will break due to incompatible node version:

Error: The module 'project-root/node_modules/canvas/build/Release/canvas.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:138)
    at process.func [as dlopen] (electron/js2c/asar.js:138)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828)
    at Object.func (electron/js2c/asar.js:138)
    at Object.func [as .node] (electron/js2c/asar.js:138)
    at Module.load (internal/modules/cjs/loader.js:645)
    at Function.Module._load (internal/modules/cjs/loader.js:560)
    at Module.require (internal/modules/cjs/loader.js:685)
    at require (internal/modules/cjs/helpers.js:16)
    at Runtime._loadModule (project-root/node_modules/jest-runtime/build/index.js:572)
    at Runtime.requireModule (project-root/node_modules/jest-runtime/build/index.js:433)
    at Runtime.requireModuleOrMock (project-root/node_modules/jest-runtime/build/index.js:598)
    at Object.<anonymous> (project-root/node_modules/canvas/lib/bindings.js:3)
    at Runtime._execModule (project-root/node_modules/jest-runtime/build/index.js:867)
    at Runtime._loadModule (project-root/node_modules/jest-runtime/build/index.js:577)
    at Runtime.requireModule (project-root/node_modules/jest-runtime/build/index.js:433)
@hustcc
Copy link
Owner

hustcc commented Jul 21, 2020

real browser dom env, no need to install canvas package.

@hustcc hustcc closed this as completed Jul 21, 2020
@Prior99
Copy link
Contributor Author

Prior99 commented Jul 21, 2020

I disagree and would ask you to re-open this. I installed canvas for another reason. I use it for creating sprites outside of tests.

@hustcc hustcc reopened this Jul 22, 2020
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

2 participants