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

Trouble Installing on Node 17 #795

Closed
stefanodongowski opened this issue Apr 20, 2022 · 5 comments
Closed

Trouble Installing on Node 17 #795

stefanodongowski opened this issue Apr 20, 2022 · 5 comments

Comments

@stefanodongowski
Copy link

(base) stefanos-mbp-2:COMP 426 stefano$ npm install better-sqlite3
npm ERR! code 1
npm ERR! path /Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh -c prebuild-install || npm run build-release
npm ERR! > [email protected] build-release
npm ERR! > node-gyp rebuild --release
npm ERR! 
npm ERR!   TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR!   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! prebuild-install WARN install No prebuilt binaries found (target=17.0.1 runtime=node arch=x64 libc= platform=darwin)
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.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/stefano/.nvm/versions/node/v17.0.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   '/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/stefano/.nvm/versions/node/v17.0.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/stefano/Library/Caches/node-gyp/17.0.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/stefano/Library/Caches/node-gyp/17.0.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/stefano/.nvm/versions/node/v17.0.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/stefano/Library/Caches/node-gyp/17.0.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3',
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! /bin/sh: 426/node_modules/better-sqlite3/build/Release/lib.host:/Users/stefano/Desktop/COMP: No such file or directory
npm ERR! node:internal/fs/utils:344
npm ERR!     throw err;
npm ERR!     ^
npm ERR! 
npm ERR! Error: ENOENT: no such file or directory, copyfile '/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c' -> '/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3/sqlite3.c'
npm ERR!     at Object.copyFileSync (node:fs:2800:3)
npm ERR!     at Object.<anonymous> (/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3/deps/copy.js:25:5)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1095:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:975:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:17:47 {
npm ERR!   errno: -2,
npm ERR!   syscall: 'copyfile',
npm ERR!   code: 'ENOENT',
npm ERR!   path: '/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c',
npm ERR!   dest: '/Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3/sqlite3.c'
npm ERR! }
npm ERR! 
npm ERR! Node.js v17.0.1
npm ERR! make: *** [ba23eeee118cd63e16015df367567cb043fed872.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/stefano/.nvm/versions/node/v17.0.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 21.2.0
npm ERR! gyp ERR! command "/Users/stefano/.nvm/versions/node/v17.0.1/bin/node" "/Users/stefano/.nvm/versions/node/v17.0.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd /Users/stefano/Desktop/COMP 426/node_modules/better-sqlite3
npm ERR! gyp ERR! node -v v17.0.1
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/stefano/.npm/_logs/2022-04-20T15_52_52_263Z-debug-0.log
(base) stefanos-mbp-2:COMP 426 stefano$ node --version
v17.0.1

I've scoured the various issues, open and closed, to try to resolve this, but I am unable to install on Node 17. I'm running on macOS Monterey.

@Prinzhorn
Copy link
Contributor

COMP 426 you cannot have white space in the path. That's a limitation of node-gyp and not better-sqlite3.

See #547 for example.

If you look closely the error reveals that in this line:

npm ERR! /bin/sh: 426/node_modules/better-sqlite3/build/Release/lib.host:/Users/stefano/Desktop/COMP: No such file or directory

@JoshuaWise
Copy link
Member

This is an issue with node-gyp (which is required by all C++ addons for Node.js). See nodejs/node-gyp#65

@tintin10q
Copy link

So what should I do? Downgrade node?

@Matheus8174
Copy link

@tintin10q just update your Node.js. I was using v17.6.0 and update to v18.5.0

@ColinRosati
Copy link

ColinRosati commented May 14, 2023

It took me a while to find a solution. The suggestions of those linked issues are to fix space in your path. So this fixed for me

/documents/cool repo/index
/doucments/cool-repo/index

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

No branches or pull requests

6 participants