specify npm install flags in package.json

What I Wanted to Do

I want to use the library better-sqlite3 which allows you to specify a custom sqlite source at install time. It looks like so:

npm install --sqlite=/path/to/sqlite-src

this flag doesnt ever change so I wanted to know if it was possible to specify flags to npm install in the package.json somewhere. It gets tedious when multiple people on a team are using the library and have to remember to add the flag when setting up the repo.

What Happened Instead

I have to specify the flag to npm install.

Reproduction Steps

if it is necessary to reproduce what I am talking about here (or just understand what I am doing), these are the docs https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/compilation.md.


Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.15.0',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  modules: '67',
  napi: '3',
  nghttp2: '1.34.0',
  node: '11.2.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '',
  zlib: '1.2.11' }

$ node -p process.platform

I have not worked through reproduce steps, but there are lots of configuration possibilities: https://docs.npmjs.com/cli/config

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.