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

gyp ERR! stack Error: make failed with exit code: 2 #332

Closed
YoussefExplicit opened this issue Dec 15, 2019 · 7 comments
Closed

gyp ERR! stack Error: make failed with exit code: 2 #332

YoussefExplicit opened this issue Dec 15, 2019 · 7 comments

Comments

@YoussefExplicit
Copy link

After running npm i better-sqlite3, I get:

[email protected] install /root/rep bot/node_modules/integer
node-gyp rebuild

make: Entering directory '/root/rep bot/node_modules/integer/build'
CXX(target) Release/obj.target/integer/src/integer.o
SOLINK_MODULE(target) Release/obj.target/integer.node
COPY Release/integer.node
COPY ../build/integer.node
TOUCH Release/obj.target/place_resulting_binary.stamp
make: Leaving directory '/root/rep bot/node_modules/integer/build'

[email protected] install /root/rep bot/node_modules/better-sqlite3
node-gyp rebuild

make: Entering directory '/root/rep bot/node_modules/better-sqlite3/build'
TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
/bin/sh: 1: bot/node_modules/better-sqlite3/build/Release/lib.host:/root/rep: not found
/root/rep bot/node_modules/better-sqlite3/deps/extract.js:8
process.on('unhandledRejection', (err) => { throw err; });
^

CwdError: ENOENT: Cannot cd into '/root/rep bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3'
at /root/rep bot/node_modules/tar/lib/mkdir.js:74:14
at FSReqCallback.oncomplete (fs.js:158:21) {
path: '/root/rep bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3',
code: 'ENOENT'
}
deps/locate_sqlite3.target.mk:16: recipe for target 'b857c92884e9598d609f6be182a2595df7a8e00f.intermediate' failed
make: *** [b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/root/rep bot/node_modules/better-sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.4.0-138-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/rep bot/node_modules/better-sqlite3
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-15T18_17_43_934Z-debug.log

@xctest
Copy link

xctest commented Dec 19, 2019

node-gyp fails too, and rebuild also fails

@theflyingape
Copy link

Same as #310 no? See my comment in regards:
#310 (comment)

@JoshuaWise
Copy link
Member

The relevant part of that error appears to be CwdError: ENOENT: Cannot cd into '/root/rep bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3', which is probably due to insufficient permissions in your file system.

@TheNoob27
Copy link

so what should he do?
well what should i do, as i also have this issue.
even running the command as sudo npm i better-sqlite3 doesnt work

@YoussefExplicit
Copy link
Author

i think i solved this issue by removing the space in the folder name
i had a folder called rep bot, but renaming it to repbot solved the issue i believe

@cekvenich
Copy link

Let me know it this fixes it, run before install: npm i -g node-gyp@latest

@coltoneshaw
Copy link

I know this is an old issue, but anyone having this problem seems directly related to spaces in the folder path. Spent hours troubleshooting only to move it up to a folder without spaces and it worked flawlessly.

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

No branches or pull requests

7 participants