且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

可以将选项添加到 npm package.json 依赖项中吗?

更新时间:2022-12-12 16:38:53

另一种方法是使用 scripts 成员并在 preinstall 或 postinstall 挂钩下设置安装脚本:

An alternative is to use the scripts member and setup the install script under the preinstall or postinstall hook:

"scripts": {
  "preinstall": "npm install --build-from-source --sqlite=/path/to/sqlite sqlite3"
},