Skip to content

Commit

Permalink
Pin target node version to be built against.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbuchan committed Sep 9, 2019
1 parent 8afb3b9 commit 7fd4399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ async function main() {
// reuse existing .node-gyp files
gyp.devDir = `${os.homedir()}/.node-gyp`;
gyp.parseArgv(process.argv);

// Override default target version.
if (!gyp.opts.target) {
gyp.opts.target = 'v10.16.0';
}

for (const { name, args } of gyp.todo) {
await promisify(gyp.commands[name])(args);
if (name == "build") {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"build": "node build build"
},
"dependencies": {
"@types/node": ">= 8.0.0"
"@types/node": "*"
},
"devDependencies": {
"node-gyp": "^5.0.3"
Expand Down
1 change: 1 addition & 0 deletions src/napi/core.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <string_view>
#include <vector>

#define NAPI_VERSION 4
#include <node_api.h>

using namespace std::string_literals;
Expand Down

0 comments on commit 7fd4399

Please sign in to comment.