Can't get Better-Sqlite3 installed on my Raspberry PI - node.js

I'm currently trying to run my Discord Bot on my Raspberry PI but I can't install Better-Sqlite3 on it. I don't really know what to do with all those errors or what they are telling me so I hope someone in here can help me with my problem. If you need any other information just let me know.
> better-sqlite3#7.1.2 install /home/pi/Discord Bot/node_modules/better-sqlite3
> prebuild-install || npm run build-release
prebuild-install WARN install No prebuilt binaries found (target=10.23.1 runtime=node arch=arm libc= platform=linux)
> better-sqlite3#7.1.2 build-release /home/pi/Discord Bot/node_modules/better-sqlite3
> node-gyp rebuild --release
make: Entering directory '/home/pi/Discord 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:/home/pi/Discord: not found
/home/pi/Discord Bot/node_modules/better-sqlite3/deps/extract.js:8
process.on('unhandledRejection', (err) => { throw err; });
^
CwdError: ENOENT: Cannot cd into '/home/pi/Discord Bot/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3'
at fs.stat (/home/pi/Discord Bot/node_modules/tar/lib/mkdir.js:74:14)
at FSReqWrap.oncomplete (fs.js:153:21)
make: *** [deps/locate_sqlite3.target.mk:17: b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/home/pi/Discord 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:191:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.4.51-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/pi/Discord Bot/node_modules/better-sqlite3
gyp ERR! node -v v10.23.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3#7.1.2 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3#7.1.2 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-01-23T13_30_26_759Z-debug.log
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/Discord Bot/package.json'
npm WARN Discord Bot No description
npm WARN Discord Bot No repository field.
npm WARN Discord Bot No README data
npm WARN Discord Bot No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3#7.1.2 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3#7.1.2 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! /home/pi/.npm/_logs/2021-01-23T13_30_27_548Z-debug.log
npm start errors:
pi#raspberrypi:~/Discord Bot $ npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/pi/Discord Bot/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/Discord Bot/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-01-23T17_14_30_893Z-debug.log

Ok I found the solution to my problem. I had a "space" in the folder name of the bot that's why the programm to install better-sqlite3 couldn't find the folder and it crashed. I just removed the space and it worked completly fine.

Related

failed to install the package quick.db

Today I tried to download the package quick.db. npm failed and sent the following error:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd C:\Users\אריאל שמילוביץ\Documents\GitHub\HighProBot-2.0\node_modules\integer
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer#3.0.1 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer#3.0.1 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\אריאל שמילוביץ\AppData\Roaming\npm-cache\_logs\2020-08-31T20_05_46_973Z-debug.log
npm WARN botjs#1.0.0 No description
npm WARN botjs#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer#3.0.1 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer#3.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I read online a bit about the problem and realized that the command should be run:
npm i --global windows-build-tools --vs2015
It did not work. npm send the same error.
After reading the error I realized that the command should be run:
npm run build-release
But when I ran the command, npm sent another problem:
npm ERR! missing script: build-release
After the script was missing, I downloaded the build-release package with the command:
npm i build-release
But that did not solve the problem
If anyone knows what the problem is, please help me.
Try running npm rebuild, it should fix an issue with incorrectly downloaded packages

Ubuntu/ Huge Error while installing npm modules

Node: 12.6.0,
Npm:6.10.1,
Ubuntu: 19.04
I got this huge error when I run
npm i <package-name> Error Link https://textsaver.flap.tv/lists/2s4g
When I include sudo sudo i <package-name> I got this error
usama#usama:~/Learn/back-end/advance-nodejs/section two$ sudo npm i webworker-threads
> webworker-threads#0.7.17 install /home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads/build'
gyp ERR! System Linux 5.0.0-20-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok
npm WARN section-two#1.0.0 No description
npm WARN section-two#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webworker-threads#0.7.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webworker-threads#0.7.17 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! /home/usama/.npm/_logs/2019-07-13T15_25_15_922Z-debug.log
usama#usama:~/Learn/back-end/advance-nodejs/section two$
Using yarn instead of npm solve the issue.

How to install npm lame raspberry pi 0

I'm trying to install npm lame on a raspberry pi 0. I've googled everything but keep getting this error:
Not really sure what else to do.
pi#raspberrypi:~/twotone $ sudo npm install lame
> lame#1.2.4 install /home/pi/twotone/node_modules/lame
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/10.15.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/twotone/node_modules/lame/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/pi/twotone/node_modules/lame/.node-gyp'
gyp ERR! System Linux 4.14.79+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/twotone/node_modules/lame
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN twotone#1.0.0 No description
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lame#1.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lame#1.2.4 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-01-06T22_12_04_380Z-debug.log
You might have to add --unsafe-perm to the npm install command

bcrypt make: execvp: g++ : not a directory

I am trying to install bcrypt using npm on redHat, I have it working on my Windows dev environment but it fails when I try to port it to the Unix test.
I am running npm intall bcrypt and recieving the following output:
$ ../../nodejs/bin/npm install bcrypt
npm WARN package.json party#0.0.0 No repository field.
npm WARN package.json party#0.0.0 No README data
-
> bcrypt#0.8.0 install /app/party/site/node_modules/bcrypt
> node-gyp rebuild
make: Entering directory `/app/party/site/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
make: execvp: g++: Not a directory
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 127
make: Leaving directory `/app/party/site/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/app/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 2.6.18-371.el5
gyp ERR! command "node" "/app/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/party/site/node_modules/bcrypt
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! bcrypt#0.8.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.8.0 install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.18-371.el5
npm ERR! command "/app/nodejs/bin/node" "/app/nodejs/bin/npm" "install" "bcrypt"
npm ERR! cwd /app/party/site
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /app/party/site/npm-debug.log
npm ERR! not ok code 0
I have been Googling for hours, but cannot work out why this is failing - please help!
Okay, thanks, I have got this working, the version of GCC I was running did not include g++, unfortunately I do not have root on this box so had to install easybuild and then use that to install a new version of GCC, then include that version in the PATH, after that the npm install bcrypt worked perfectly.

Trying to understand `npm` install errors

I am new to node. Can someone please tell me why this is failing?
sudo su
nvm use 0.10
git clone https://github.com/bitpay/insight.git && cd insight
npm install
...output omitted...
> leveldown#0.10.2 install /insight/node_modules/insight-bitcore-api/node_modules/leveldown
> node-gyp rebuild
gyp: Call to 'node -e "require('nan')"' returned exit status 1. 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 (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.11.0-19-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /insight/node_modules/insight-bitcore-api/node_modules/leveldown
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
...
npm ERR! Error: ENOENT, lstat '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.11.0-19-generic
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "install"
npm ERR! cwd /insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat
npm ERR! fstream_path /insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /root/.nvm/v0.10.26/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process'
npm ERR! error rolling back insight-bitcore-api#0.1.9 { [Error: ENOTEMPTY, rmdir '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process' }
npm ERR! leveldown#0.10.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown#0.10.2 install script.
npm ERR! This is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-19-generic
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "install"
npm ERR! cwd /insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
Any insight into this is appreciated! I'm only listing the first ERR blocks...
This line:
/bin/sh: 1: node: not found
leads me to believe node isn't properly installed.. What happens when you type 'node' on a command line?
You need to have nodejs to be accessible with node in the command line.
But: In the Ubuntu repos there is a confusion/conflict between nodejs and ax25-node, the latter occupying the /usr/bin/node path. When you never installed node aka ax25-node you can simply
sudo aptitude install nodejs-legacy
This installs nodejs and creates a symbolic link to /usr/bin/node.
Now npm installs run without any error messages.
In my case the same error as yours appeared when trying to
npm install -g Haraka
The solution is from a fairly unrelated stackoverflow post:
nodejs vs node on ubuntu 12.04
I ran npm install node (even though it was already installed to some degree) and the issue was resolved.

Resources