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.

`NODE_MODULE_VERSION` and `fsevents`

See original GitHub issue

Current behavior:

Error: The module '/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/watchify/node_modules/fsevents/build/Release/fse.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 76. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:140:31)
    at process.func [as dlopen] (electron/js2c/asar.js:140:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1016:18)
    at Object.func (electron/js2c/asar.js:140:31)
    at Object.func [as .node] (electron/js2c/asar.js:140:31)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at bindings (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/watchify/node_modules/fsevents/fsevents.js:12:33)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/watchify/node_modules/chokidar/lib/fsevents-handler.js:7:18)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/watchify/node_modules/chokidar/index.js:16:23)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/watchify/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/browserify-preprocessor/index.js:9:18)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at setDefaultPreprocessor (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/preprocessor.js:49:18)
    at Object.getFile (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/preprocessor.js:90:9)
    at Socket.watchTestFileByPath (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/socket.js:100:25)
    at Socket.<anonymous> (/Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/lib/socket.js:288:14)
    at Socket.emit (events.js:210:5)
    at /Users/Vaughan/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/socket/node_modules/socket.io/lib/socket.js:528:12
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

NODE_MODULE_VERSION 76 =

Electron v6.1.8
2020-02-21
Node 12.4.0

NODE_MODULE_VERSION 72 =

v6.0.0-nightly.20190213 | 2019-02-14 |   | yes | 12.0.0 | 72 | 245
v6.0.0-nightly.20190212 | 2019-02-12 |   | yes | 12.0.0 | 72 | 13

https://www.npmjs.com/package/electron-releases

I deleted Cypress and installed a fresh binary and I get this error. I don’t know how it can be happening because all these deps should be packaged with Cypress.

I am using cypress-terminal-report in my plugins.

I also tried setting nodeVersion: 'system' with no effect.

Running npm rebuild inside that dir will use my system NODE_MODULE_VERSION which is currently 79 which still causes issue.


I am also using pnpm which adds bin shims so this might be the problem:

cat ./node_modules/.bin/cypress

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

export NODE_PATH="xxx/node_modules/.pnpm/registry.npmjs.org/cypress/4.3.0/node_modules/cypress/bin/cypress/node_modules:xxx/node_modules/.pnpm/registry.npmjs.org/cypress/4.3.0/node_modules/cypress/bin/node_modules:xxx/node_modules/.pnpm/registry.npmjs.org/cypress/4.3.0/node_modules/cypress/node_modules:xxx/node_modules/.pnpm/registry.npmjs.org/cypress/4.3.0/node_modules:xxx/node_modules/.pnpm/registry.npmjs.org/cypress/node_modules:xxx/node_modules/.pnpm/registry.npmjs.org/node_modules:xxx/node_modules/.pnpm/node_modules:xxx/node_modules:/Users/Vaughan/dev-projects/xxxapi/dev-xxx-js/node_modules:/Users/Vaughan/dev-projects/xxxapi/node_modules:/Users/Vaughan/dev-projects/node_modules:/Users/Vaughan/node_modules:/Users/node_modules:/node_modules:xxx/packages/apps/web/node_modules/cypress/bin/cypress/node_modules:xxx/packages/apps/web/node_modules/cypress/bin/node_modules:xxx/packages/apps/web/node_modules/cypress/node_modules:xxx/packages/apps/web/node_modules:xxx/packages/apps/node_modules:xxx/packages/node_modules"
if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../cypress/bin/cypress" "$@"
else
  exec node  "$basedir/../cypress/bin/cypress" "$@"
fi

Desired behavior:

Should not throw error.

Test code to reproduce

TODO

Versions

Cypress 4.3.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
vjprcommented, Apr 9, 2020

Fix!

npm i -g electron-rebuild

cd "~/Library/Caches/Cypress/4.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/watchify/"

electron-rebuild --version=8  fsevents

Todo

Not sure why it only happens to me though. Maybe some caching issue or something caused by using pnpm.

0reactions
kshammoutcommented, Jul 27, 2020

Sorry i can’t do that since the repo owner is the company , but i can share with you the package file , when i remove canvas file the issue working fine , but i don’t understand which dependency reasonable about add canvas ?

{code} , “description”: “”, “main”: “index.js”, “devDependencies”: { “@applitools/eyes-cypress”: “^3.12.4”, “@shelex/cypress-allure-plugin”: “^1.6.2”, “@wdio/allure-reporter”: “^6.1.22”, “@wdio/cli”: “^6.1.22”, “@wdio/local-runner”: “^6.1.22”, “@wdio/sync”: “^6.1.14”, “axe-core”: “^3.5.1”, “babel-loader”: “^8.0.6”, “babel-plugin-istanbul”: “^6.0.0”, “chromedriver”: “^83.0.0”, “cross-env”: “^7.0.0”, “cypress”: “^4.7.0”, “cypress-axe”: “^0.8.1”, “cypress-cucumber-preprocessor”: “^2.3.1”, “cypress-file-upload”: “^4.0.7”, “cypress-plugin-retries”: “^1.5.2”, “cypress-wait-until”: “^1.7.1”, “cypress-xpath”: “^1.6.0”, “electron-prebuilt”: “^1.4.13”, “electron-rebuild”: “^1.11.0”, “http-proxy-middleware”: “^0.20.0”, “istanbul-lib-coverage”: “^3.0.0”, “marge”: “^1.0.1”, “minimist”: “^1.2.5”, “mocha”: “^3.5.3”, “mocha-multi”: “^0.11.0”, “mochawesome”: “^4.1.0”, “mochawesome-merge”: “^2.0.1”, “nyc”: “^15.0.0”, “wdio-chromedriver-service”: “^6.0.3” }, “keywords”: [], “repository”: { “type”: “git”, “url”: “git+https://github.com/atypon/iam-fe.git” }, “bugs”: { “url”: “https://github.com/atypon/iam-fe/issues” }, “browserslist”: { “development”: [ “last 2 chrome versions”, “last 2 firefox versions”, “last 2 edge versions” ] }, “dependencies”: { “@wdio/cucumber-framework”: “^6.1.22”, “@wdio/dot-reporter”: “^6.1.14”, “@wdio/mocha-framework”: “^6.1.19”, “@wdio/selenium-standalone-service”: “^6.1.14”, “btoa”: “^1.2.1”, “chai”: “^4.2.0”, “chai-http”: “^4.3.0”, “wdio-allure-ts”: “^1.2.5”, “wdio-video-reporter”: “^3.0.0” } {code}

Read more comments on GitHub >

github_iconTop Results From Across the Web

fsevents - npm
Install · Repository · Homepage · Weekly Downloads · Version · License · Unpacked Size · Total Files.
Read more >
How to solve npm install throwing fsevents warning on non ...
Linux system ignores fsevents whereas mac install it. ... You can update your npm version or update to node v15 or higher, which...
Read more >
What is fsevents? Why do a lot of node_modules depend on ...
The module structure used to be completely nested, meaning multiple versions of the same modules could be nested within each other. This is...
Read more >
Node: 12.2.0 throws error during npm install #278 - GitHub
Document supported npm versions for JS dev environment mlflow/mlflow#1506 ... I'm using version fsevents@1.2.9 and still get a build error.
Read more >
fsevents | Yarn - Package Manager
NPM. Native access to MacOS FSEvents in Node.js. The FSEvents API in MacOS allows applications to register for notifications of changes to a...
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