question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

install-app-deps run as a package.json script fails with yarn >= v0.24.0-0.24.4

See original GitHub issue
  • Version: 17.5.0
  • Target: OSX

When running install-app-deps from a script field in package.json with yarn, it fails in some cases. NPM runs it fine, and older versions of yarn run it fine. Here is an example:

bret-zh:vneck bret$ yarn run postinstall:app-deps
yarn run v0.24.0
$ install-app-deps 
Rebuilding native production dependencies for darwin:x64
Rebuilding native dependency sqlite3
Error: /usr/local/Cellar/node/7.10.0/bin/node exited with code 1
Output:
yarn run v0.24.0
$ node-pre-gyp install --fallback-to-build 
Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Error output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.31
node-pre-gyp info using node@7.10.0 | darwin | x64
node-pre-gyp info build requesting source compile
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/bret/zhealth/vneck/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack     at emitOne (events.js:96:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
node-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:367:16)
node-pre-gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:80:11)
node-pre-gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:104:9)
node-pre-gyp ERR! stack     at Module.runMain (module.js:607:11)
node-pre-gyp ERR! stack     at run (bootstrap_node.js:427:7)
node-pre-gyp ERR! stack     at startup (bootstrap_node.js:151:9)
node-pre-gyp ERR! System Darwin 16.5.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/7.10.0/bin/node" "/Users/bret/zhealth/vneck/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/bret/zhealth/vneck/node_modules/sqlite3
node-pre-gyp ERR! node -v v7.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok 
error Command failed with exit code 1.

    at ChildProcess.childProcess.once.code (/Users/bret/zhealth/vneck/node_modules/electron-builder-util/src/util.ts:135:14)
    at Object.onceWrapper (events.js:293:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:511:12)
From previous event:
    at spawn (/Users/bret/zhealth/vneck/node_modules/electron-builder-util/src/util.ts:103:3)
    at /Users/bret/zhealth/vneck/node_modules/electron-builder/src/yarn.ts:117:7
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at /Users/bret/zhealth/vneck/node_modules/electron-builder/src/yarn.ts:115:27
From previous event:
    at rebuild (/Users/bret/zhealth/vneck/node_modules/electron-builder/out/yarn.js:93:22)
    at /Users/bret/zhealth/vneck/node_modules/electron-builder/src/yarn.ts:16:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at installOrRebuild (/Users/bret/zhealth/vneck/node_modules/electron-builder/out/yarn.js:33:21)
    at /Users/bret/zhealth/vneck/node_modules/electron-builder/src/cli/install-app-deps.ts:32:2
    at Generator.next (<anonymous>)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
From previous event:
    at main (/Users/bret/zhealth/vneck/node_modules/electron-builder/out/cli/install-app-deps.js:36:21)
    at Object.<anonymous> (/Users/bret/zhealth/vneck/node_modules/electron-builder/out/cli/install-app-deps.js:72:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bcomnescommented, May 16, 2017

Looks like a natural place to fix this is in node-pre-gyp: https://github.com/yarnpkg/yarn/pull/3240#issuecomment-301632931

0reactions
bcomnescommented, Aug 10, 2017

The node-pre-gyp issues persist unfortunately (for spawning), but yeah you are going to need dev-deps for the dev things 😛

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found