File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2
2
const setPATH = require ( './set-path.js' )
3
3
const { resolve } = require ( 'path' )
4
4
let npm_config_node_gyp
5
- if ( typeof require === 'function' && typeof require . resolve === 'function' ) {
6
- npm_config_node_gyp = require . resolve ( 'node-gyp/bin/node-gyp.js' )
5
+ try {
6
+ /* istanbul ignore next */
7
+ if ( typeof require === 'function' && typeof require . resolve === 'function' ) {
8
+ npm_config_node_gyp = require . resolve ( 'node-gyp/bin/node-gyp.js' )
9
+ }
10
+ } catch ( er ) {
11
+ /* istanbul ignore next */
12
+ console . warn ( '> @npmcli/run-script: Failed auto-locating `node-gyp`' )
7
13
}
8
14
9
15
const makeSpawnArgs = options => {
@@ -27,6 +33,7 @@ const makeSpawnArgs = options => {
27
33
npm_lifecycle_event : event ,
28
34
npm_lifecycle_script : cmd ,
29
35
} )
36
+ /* istanbul ignore next */
30
37
if ( typeof npm_config_node_gyp === 'string' ) {
31
38
spawnEnv . npm_config_node_gyp = npm_config_node_gyp
32
39
}
You can’t perform that action at this time.
0 commit comments