Skip to content

Commit d50b121

Browse files
committed
fix: don't fail if node-gyp location is not found
1 parent 2c2a014 commit d50b121

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ const byline = require('byline')
1717
const resolveFrom = require('resolve-from')
1818
const { PassThrough } = require('stream')
1919

20-
const DEFAULT_NODE_GYP_PATH = resolveFrom(__dirname, 'node-gyp/bin/node-gyp')
20+
let DEFAULT_NODE_GYP_PATH
21+
try {
22+
DEFAULT_NODE_GYP_PATH = resolveFrom(__dirname, 'node-gyp/bin/node-gyp')
23+
} catch (err) {}
24+
2125
const hookStatCache = new Map()
2226

2327
let PATH = 'PATH'

0 commit comments

Comments
 (0)