When my app has been asleep and a web request wakes it, it appears that NPM packages are reinstalled. In turn, then, the installer for the better-sqlite3
package rebuilds sqlite3 via gyp
whether it needs it or not. Because that rebuild takes a while:
node v8.9.4, with pnpm
Installing...
A store server is running. All store manipulations are delegated to it.
Already up-to-date
Packages: +89
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Running install for registry.npmjs.org/better-sqlite3/4.1.0: ==> cwd: /rbd/pnpm-volume/de140b15-6961-4165-a750-fccbe3965b72/node_modules/.registry.npmjs.org/better-sqlite3/4.1.0/node_modules/better-sqlite3
Running install for registry.npmjs.org/better-sqlite3/4.1.0: ==> /rbd/pnpm-volume/de140b15-6961-4165-a750-fccbe3965b72/node_modules/.registry.npmjs.org/lzz-gyp/0.4.2/node_modules/lzz-gyp/lzz-compiled/linux -hx hpp -sx cpp -k BETTER_SQLITE3 -d -hl -sl -e ./src/better_sqlite3.lzz
Running install for registry.npmjs.org/better-sqlite3/4.1.0: ==> cwd: /rbd/pnpm-volume/de140b15-6961-4165-a750-fccbe3965b72/node_modules/.registry.npmjs.org/better-sqlite3/4.1.0/node_modules/better-sqlite3
Running install for registry.npmjs.org/better-sqlite3/4.1.0: ==> node-gyp rebuild
...
Running install for registry.npmjs.org/integer/1.0.3! gyp info ok
Running install for registry.npmjs.org/integer/1.0.3, done
dependencies:
+ @slack/client 3.16.0
+ better-sqlite3 4.1.0
Total install time: 100947ms
…the web request times out. Is there a way to prevent NPM reinstallation on startup? Or, is there some way to make gyp
not actually recompile sqlite3 if it’s already present?