Better-sqlite3: Installation Issue

Created on 9 Sep 2018  路  8Comments  路  Source: JoshuaWise/better-sqlite3

My OS is Windows 10

I got a issue on installation of better-sqlite3, if someone can helps me, i would be appreciated.

`PS C:\Users\rodri\Desktop\Wild Arena BOT> npm install --save better-sqlite3

[email protected] install C:\Users\rodri\Desktop\Wild Arena BOT\node_modules\better-sqlite3
node-gyp rebuild

C:\Users\rodri\Desktop\Wild Arena BOT\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgypgyp_main.py", line 16, in
sys.exit(gyp.script_main())
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgyp\pylibgyp__init__.py", line 545, in script_main
return main(sys.argv[1:])
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgyp\pylibgyp__init__.py", line 538, in main
return gyp_main(args)
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgyp\pylibgyp__init__.py", line 514, in gyp_main
options.duplicate_basename_check)
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgyp\pylibgyp__init__.py", line 98, in Load
generator.CalculateVariables(default_variables, params)
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgyp\pylibgyp\generator\msvs.py", line 1916, in CalculateVariables
generator_flags.get('msvs_version', 'auto'))
File "C:Program Files\nodejs\node_modules\npm\node_modules\node-gypgyp\pylibgyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2017'
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:336:16)
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 Windows_NT 10.0.17134
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"
gyp ERR! cwd C:\Users\rodri\Desktop\Wild Arena BOT\node_modules\better-sqlite3
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN discord.[email protected] requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.[email protected] requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.[email protected] requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.[email protected] requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.[email protected] requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.[email protected] requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.[email protected] requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.
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! C:\Users\rodri\AppData\Roaming\npm-cache_logs\2018-09-09T15_16_33_957Z-debug.log`

help wanted

Most helpful comment

I found that there are problems with installing this because node-gyp REQUIRES the v140 visual studio tools. I finally found a solution that worked for me (I'm on Win 10).

npm install --global --production windows-build-tools --vs2015

The --vs2015 is critical because it forces the v140 tool set to be installed. I figured this out from a variety of sources, but in particular @npk48 comments here pointed me in the right direction.

All 8 comments

Same thing here.

Node v10.10.0
NPM v6.4.1

edit: I'm a big stupidhead and didn't look at the troubleshooting section

versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2017'

according to that line,
Do you have any visual studio installed?

After doing a google search, I found this thread which seems to be talking about the same error message: https://github.com/nodejs/node-gyp/issues/1144

Try following that thread to solve your issue, and report back here whether the thread was helpful.

I found that there are problems with installing this because node-gyp REQUIRES the v140 visual studio tools. I finally found a solution that worked for me (I'm on Win 10).

npm install --global --production windows-build-tools --vs2015

The --vs2015 is critical because it forces the v140 tool set to be installed. I figured this out from a variety of sources, but in particular @npk48 comments here pointed me in the right direction.

@TheBoss0001 did @jbrown123's suggestion work for you?

Closing this due to unresponsiveness.

@JoshuaWise thanks for the tips. I found I needed to install both vs2015 and the latest default (vs2017) to get all my native deps to compile. See https://github.com/JoshuaWise/better-sqlite3/issues/170#issuecomment-441734343

I know this has been closed but spaces in your URL 'C:\Users\rodri\Desktop\Wild Arena BOT' have also been found to have a few issues with some people.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

k1ngrnbz picture k1ngrnbz  路  4Comments

jonataswalker picture jonataswalker  路  5Comments

Babalon921 picture Babalon921  路  3Comments

ccpwcn picture ccpwcn  路  4Comments

BobbyT picture BobbyT  路  3Comments