tink: Trying to use a package with node-gyp dependencies results in calls to tish-gyp, which fails

Given:

{
  "name": "example",
  "version": "1.0.0",
  "dependencies": {
    "integer": "*"
  }
}

and

{
  "name": "example",
  "version": "1.0.0",
  "lockfileVersion": 1,
  "requires": true,
  "dependencies": {
    "integer": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/integer/-/integer-2.1.0.tgz",
      "integrity": "sha512-vBtiSgrEiNocWvvZX1RVfeOKa2mCHLZQ2p9nkQkQZ/BvEiY+6CcUz0eyjvIiewjJoeNidzg2I+tpPJvpyspL1w=="
    }
  }
}

and an index.js of:

const i = require('integer')
console.log('hello, world')

Running tish index.js results in:

> integer@2.1.0 install /Users/rebecca/code/npmtest/tink-boom/node_modules/integer
> tish-gyp rebuild

tink ERR! prepare Error: integer@2.1.0 install: `tish-gyp rebuild`
tink ERR! prepare spawn sh ENOENT
tink ERR! prepare     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
tink ERR! prepare     at onErrorNT (internal/child_process.js:427:16)
tink ERR! prepare     at processTicksAndRejections (internal/process/next_tick.js:76:17)
tink ERR! prepare  { Error: integer@2.1.0 install: `tish-gyp rebuild`
tink ERR! prepare spawn sh ENOENT
tink ERR! prepare     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
tink ERR! prepare     at onErrorNT (internal/child_process.js:427:16)
tink ERR! prepare     at processTicksAndRejections (internal/process/next_tick.js:76:17)
tink ERR! prepare   stack:
tink ERR! prepare    'Error: integer@2.1.0 install: `tish-gyp rebuild`\nspawn sh ENOENT\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)\n    at onErrorNT (internal/child_process.js:427:16)\n    at processTicksAndRejections (internal/process/next_tick.js:76:17)',
tink ERR! prepare   errno: 'ENOENT',
tink ERR! prepare   code: 'ELIFECYCLE',
tink ERR! prepare   syscall: 'spawn sh',
tink ERR! prepare   path: 'sh',
tink ERR! prepare   spawnargs: [ '-c', 'tish-gyp rebuild' ],
tink ERR! prepare   file: 'sh',
tink ERR! prepare   pkgid: 'integer@2.1.0',
tink ERR! prepare   stage: 'install',
tink ERR! prepare   script: 'tish-gyp rebuild',
tink ERR! prepare   pkgname: 'integer' }
tink shell

Launch a tink shell or execute a script

Options:
  --version, -v                 Show version number                    [boolean]
  --help, -h                    Show help                              [boolean]
  --prefix, -C                  Directory to execute package management
                                operations in.                          [string]
  --ignore-scripts
  --nodeArg, -n, --node-arg     Arguments to pass down directly to node  [array]
  --restore, --restore-missing                         [boolean] [default: true]
  --production                  Limit downloads to production dependencies,
                                skipping devDependencies.              [boolean]

{ /Users/rebecca/code/npmtest/tink-boom/node_modules/integer/lib/index.js:1
Error: Cannot find module '../build/integer.node'
    at Object.<anonymous> (/Users/rebecca/code/npmtest/tink-boom/node_modules/integer/lib/index.js:2:34)
    at Generator.next (<anonymous>)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10) code: 'MODULE_NOT_FOUND' }

Hahahahaha that’s fantastic

Fix: https://github.com/npm/tink/pull/46

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.