I have a setup which is working fine on Windows but it is not installing on Mac OS (GitHub Actions): https://github.com/evandroforks/anki/runs/607942390?check_suite_focus=true#step:27:438
> [email protected] install /Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/@types/gulp/node_modules/fsevents
> node-gyp rebuild
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'nan'
Require stack:
- /Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/@types/gulp/node_modules/fsevents/[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at [eval]:1:1
at Script.runInThisContext (vm.js:120:20)
at Object.runInThisContext (vm.js:311:38)
at Object.<anonymous> ([eval]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at evalScript (internal/process/execution.js:94:25) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/@types/gulp/node_modules/fsevents/[eval]'
]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/runner/hostedtoolcache/node/12.16.2/x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/Users/runner/hostedtoolcache/node/12.16.2/x64/bin/node" "/Users/runner/hostedtoolcache/node/12.16.2/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/@types/gulp/node_modules/fsevents
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> [email protected] install /Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/glob-watcher/node_modules/fsevents
> node-gyp rebuild
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'nan'
Require stack:
- /Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/glob-watcher/node_modules/fsevents/[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at [eval]:1:1
at Script.runInThisContext (vm.js:120:20)
at Object.runInThisContext (vm.js:311:38)
at Object.<anonymous> ([eval]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at evalScript (internal/process/execution.js:94:25) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/glob-watcher/node_modules/fsevents/[eval]'
]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/runner/hostedtoolcache/node/12.16.2/x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/Users/runner/hostedtoolcache/node/12.16.2/x64/bin/node" "/Users/runner/hostedtoolcache/node/12.16.2/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/runner/runners/2.169.0/work/anki/anki/qt/ts/node_modules/glob-watcher/node_modules/fsevents
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@types/gulp/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/glob-watcher/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 423 packages from 327 contributors and audited 258938 packages in 13.602s
Please ask gulp-watcher maintainers to upgrade: https://github.com/gulpjs/glob-watcher/pull/42
What do they need to update? Can I update it on my package.json while they do not fix it?
Because the error is related to unsupported fsevents version. We only support fsevents v2.
You could pin your fsevents to v2, but i'm not sure if that'll work.
I fixed it by adding npm install --no-optional
Most helpful comment
I fixed it by adding
npm install --no-optional