Better-sqlite3: Installation Failed at the [email protected] install script.

Created on 30 Jan 2018  路  7Comments  路  Source: JoshuaWise/better-sqlite3

I can't install on linux server. Can you please help me?

balckets@nlss9 [~]# npm install -g better-sqlite3

[email protected] install /home/balckets/lib/node_modules/better-sqlite3/node_modules/integer
node tools/install

make: Entering directory /home/balckets/lib/node_modules/better-sqlite3/node_modules/integer/build' CXX(target) Release/obj.target/integer/src/integer.o cc1plus: error: unrecognized command line option "-std=c++11" make: *** [Release/obj.target/integer/src/integer.o] Error 1 make: Leaving directory/home/balckets/lib/node_modules/better-sqlite3/node_modules/integer/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/balckets/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 2.6.32-773.26.1.lve1.4.46.el6.x86_64
gyp ERR! command "/home/balckets/bin/node" "/home/balckets/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/balckets/lib/node_modules/better-sqlite3/node_modules/integer
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node tools/install
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! /home/balckets/.npm/_logs/2018-01-30T02_20_00_622Z-debug.log
2018-01-30T02_20_00_622Z-debug.log

bug

Most helpful comment

@EKomateas ran into a similar problem in https://github.com/JoshuaWise/better-sqlite3/issues/96 -- try rolling back your global npm version to 4.3.0:

$ npm install -g [email protected]

or setting permissions in npm5:

$ npm config set unsafe-perm=true

All 7 comments

I think you need to install dependencies of node-gyp.

  • python (v2.7 recommended, v3.x.x is not supported)
  • make
  • A proper C/C++ compiler toolchain, like GCC

If this recommendation didn鈥檛 help you, then look at troubleshooting guide

I have already install node-gyp dependencies. The problem is related with installation of "integer".
I have tried to make the install on 3 different linux servers and I got the same error:
balckets@nlss9 [~]# npm install -g integer

[email protected] install /home/balckets/lib/node_modules/integer
node tools/install

make: Entering directory /home/balckets/lib/node_modules/integer/build' CXX(target) Release/obj.target/integer/src/integer.o cc1plus: error: unrecognized command line option "-std=c++11" make: *** [Release/obj.target/integer/src/integer.o] Error 1 make: Leaving directory/home/balckets/lib/node_modules/integer/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/balckets/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 2.6.32-773.26.1.lve1.4.46.el6.x86_64
gyp ERR! command "/home/balckets/bin/node" "/home/balckets/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/balckets/lib/node_modules/integer
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node tools/install
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! /home/balckets/.npm/_logs/2018-01-30T13_51_54_733Z-debug.log

Maybe the problem is the version of gcc 4.4.7. It is inpossible to install a newer version to my server. Can we do something about it or I have to migrate to another sqlite3 package.

Thank you

@EKomateas ran into a similar problem in https://github.com/JoshuaWise/better-sqlite3/issues/96 -- try rolling back your global npm version to 4.3.0:

$ npm install -g [email protected]

or setting permissions in npm5:

$ npm config set unsafe-perm=true

@EKomateas do @reviewher's comments resolve your issue?

@reviewher thx, rolling back global npm version helps

In know this is pretty stupid but i just changed the projects directory and moved the files and it installed fine lol; Maybee try with sudo?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonataswalker picture jonataswalker  路  5Comments

Silve2611 picture Silve2611  路  6Comments

geopic picture geopic  路  3Comments

mann-david picture mann-david  路  5Comments

spiffytech picture spiffytech  路  5Comments