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

Error: Cannot find module './build.ts' #530

Closed
tiagosiebler opened this issue Nov 18, 2022 · 3 comments · Fixed by #531
Closed

Error: Cannot find module './build.ts' #530

tiagosiebler opened this issue Nov 18, 2022 · 3 comments · Fixed by #531
Labels

Comments

@tiagosiebler
Copy link

Describe the bug
zeromq just doesn't install due to a make error:

$ npm i zeromq                    
npm ERR! code 1
npm ERR! path /Volumes/Repositories/Private/Trading/tstests/node_modules/zeromq
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! TOUCH 7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate
npm ERR!   ACTION binding_gyp_libzmq_target_build_libzmq 7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate
npm ERR! rm 7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/local/opt/[email protected]/bin/python3.10"
npm ERR! gyp info spawn /usr/local/opt/[email protected]/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/ts/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Volumes/Repositories/Private/Trading/tstests/node_modules/zeromq/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/ts/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/ts/Library/Caches/node-gyp/18.12.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/ts/Library/Caches/node-gyp/18.12.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/ts/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/ts/Library/Caches/node-gyp/18.12.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Volumes/Repositories/Private/Trading/tstests/node_modules/zeromq',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! node:internal/modules/cjs/loader:998
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module './build.ts'
npm ERR! Require stack:
npm ERR! - /Volumes/Repositories/Private/Trading/tstests/node_modules/zeromq/script/imaginaryUncacheableRequireResolveScript
npm ERR!     at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
npm ERR!     at Function.resolve (node:internal/modules/cjs/helpers:109:19)
npm ERR!     at requireResolveNonCached (/Volumes/Repositories/Private/Trading/tstests/node_modules/ts-node/dist/bin.js:549:16)
npm ERR!     at getProjectSearchDir (/Volumes/Repositories/Private/Trading/tstests/node_modules/ts-node/dist/bin.js:519:40)
npm ERR!     at phase3 (/Volumes/Repositories/Private/Trading/tstests/node_modules/ts-node/dist/bin.js:267:27)
npm ERR!     at bootstrap (/Volumes/Repositories/Private/Trading/tstests/node_modules/ts-node/dist/bin.js:47:30)
npm ERR!     at main (/Volumes/Repositories/Private/Trading/tstests/node_modules/ts-node/dist/bin.js:33:12)
npm ERR!     at Object.<anonymous> (/Volumes/Repositories/Private/Trading/tstests/node_modules/ts-node/dist/bin.js:579:5)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1159:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '/Volumes/Repositories/Private/Trading/tstests/node_modules/zeromq/script/imaginaryUncacheableRequireResolveScript'
npm ERR!   ]
npm ERR! }
npm ERR! 
npm ERR! Node.js v18.12.1
npm ERR! make: *** [7722eaf02fcc073df28ffd1fa831e71544edfd42.intermediate] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/ts/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 22.1.0
npm ERR! gyp ERR! command "/Users/ts/.nvm/versions/node/v18.12.1/bin/node" "/Users/ts/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Volumes/Repositories/Private/Trading/tstests/node_modules/zeromq
npm ERR! gyp ERR! node -v v18.12.1
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ts/.npm/_logs/2022-11-18T17_00_38_288Z-debug-0.log

Reproducing
If possible, provide a list of commands or a code sample that reproduces the bug that you are observing. Otherwise please describe as much as possible in which circumstances the bug can be observed.

  • Use node LTS (18.12.1)
  • npm install zeromq

Expected behavior
Expected it to install...

Tested on

  • Node: v18.12.1
  • OS: macOS 13.0
  • ZeroMQ.js version: 6.0.0-beta.10, @latest
@kavsingh
Copy link

kavsingh commented Nov 18, 2022

script/build.ts is not included in package's files so I guess it doesn't get shipped? lists script/build.sh instead:
https://github.com/zeromq/zeromq.js/blob/v6.0.0-beta.10/package.json#L70
just an observation might not be relevant

@aminya
Copy link
Member

aminya commented Nov 18, 2022

I wonder why the prebuilt libraries are not picked for MacOS here. It should not try to build at all.

@tiagosiebler
Copy link
Author

Thanks @aminya - can confirm fix is working, in case there was any doubt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants