better-sqlite3 icon indicating copy to clipboard operation
better-sqlite3 copied to clipboard

Installation error: cannot open file 'gdi32.lib'

Open CubzDev opened this issue 4 years ago • 13 comments

I'm trying to install better sqlite, but for some reason i keep on having the same issue.

LINK : fatal error LNK1104: cannot open file 'gdi32.lib' [C:\Users\Admin\Desktop\Projects\Discord Bot\node_modules\better-sqlite3\build\better_sq lite3.vcxproj] test_extension.c win_delay_load_hook.cc LINK : fatal error LNK1104: cannot open file 'gdi32.lib' [C:\Users\Admin\Desktop\Projects\Discord Bot\node_modules\better-sqlite3\build\test_exte nsion.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exefailed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:310:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275: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\Admin\Desktop\Projects\Discord Bot\node_modules\better-sqlite3 gyp ERR! node -v v12.16.2 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build-release:node-gyp rebuild --release` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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\Admin\AppData\Roaming\npm-cache_logs\2020-08-13T12_42_32_731Z-debug.log npm WARN [email protected] requires a peer of erlpack@hammerandchisel/erlpack#master but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of node-opus@^0.2.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of opusscript@^0.0.1 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of uws@^0.12.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: prebuild-install || npm run build-release 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.`

Thats the error message i get and have been stuck with for quite some time now.

CubzDev avatar Aug 13 '20 12:08 CubzDev

There seems to be a lot of issue installing on windows lately, the developer could fix these by providing prebuilt binaries for windows, like he does for linux

stoneRdev avatar Sep 03 '20 08:09 stoneRdev

The same problem occurs in mac (catalina), too.

anilbhattaraitoronto avatar Sep 15 '20 08:09 anilbhattaraitoronto

The same problem with me, but i do npm rebuild or rm -rf node_modules && npm install that's work!

hansputera avatar Nov 06 '20 05:11 hansputera

Has anyone tried the solution presented by @hansputera ?

JoshuaWise avatar Dec 19 '20 19:12 JoshuaWise

my friends 😅

hansputera avatar Dec 21 '20 06:12 hansputera

Has anyone tried the solution presented by @hansputera ?

I tried it on macOS, none of works.

❯ npm install better-sqlite3

(node:30718) ExperimentalWarning: The fs.promises API is experimental
npm ERR! code 1
npm ERR! path .../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! (node:30748) ExperimentalWarning: The fs.promises API is experimental
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 spawn /usr/bin/python2
npm ERR! gyp info spawn args [ '.../node_modules/node-gyp/gyp/gyp_main.py',

❯ node --version v10.15.1

i-chaochen avatar Feb 06 '21 15:02 i-chaochen

MacOS:

  1. Install XCode
  2. Once XCode is installed, go to Preferences, Downloads, and install the Command Line Tools.

Windows:

  1. npm i -g --add-python-to-path --vs2015 --production windows-build-tools
  2. npm i -g node-gyp@latest

Linux:

  1. sudo apt-get install build-essential

hansputera avatar Feb 07 '21 04:02 hansputera

Source: https://enmap.evie.dev/install#pre-requisites

hansputera avatar Feb 07 '21 04:02 hansputera

Has anyone tried the solution presented by @hansputera ?

I have not. I dont have a mac and I plain refuse to install anything Visual Studio on my machines (if some software bundles it then sure I guess, but I don't like it)

stoneRdev avatar Mar 01 '21 06:03 stoneRdev

Has anyone tried the solution presented by @hansputera ?

I just tried it (the vs2015 part), and can confirm it works, though I'd like to point out that if your using nvm with custom paths, you may have to move some files yourself

stoneRdev avatar Mar 02 '21 01:03 stoneRdev

Has anyone tried the solution presented by @hansputera ?

I just tried it (the vs2015 part), and can confirm it works, though I'd like to point out that if your using nvm with custom paths, you may have to move some files yourself

I just try to downgrade the node version to v12, and it works.

hansputera avatar Mar 08 '21 05:03 hansputera

I tried with node version v15 and v14 won't work.

hansputera avatar Mar 08 '21 05:03 hansputera

Can you see if it works in v7.4.4?

JoshuaWise avatar Oct 25 '21 14:10 JoshuaWise

Closing due to inactivity

JoshuaWise avatar Nov 21 '22 23:11 JoshuaWise