Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Error: spawn ... snyk ENOENT #3

Closed
asos-craigmorten opened this issue Dec 16, 2021 · 0 comments · Fixed by #4
Closed

bug: Error: spawn ... snyk ENOENT #3

asos-craigmorten opened this issue Dec 16, 2021 · 0 comments · Fixed by #4
Assignees
Labels
bug Something isn't working

Comments

@asos-craigmorten
Copy link
Contributor

Issue

Details

When using npx @asos/snyker and snyk or @asos/snyker hasn't been globally installed you get the following error:

$ npx @asos/snyker
Need to install the following packages:
  @asos/snyker
Ok to proceed? (y) y
[SNYKER: STARTING]
[SNYKER: STEP 1]: Ensuring lockfile 'yarn.lock' is up to date.

yarn install v1.22.15
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Saved lockfile.
Done in 0.21s.

[SNYKER: STEP 2]: Deleting '.snyk' file.
[SNYKER: STEP 3]: Getting vulnerable paths from Snyk.
An error was thrown while executing the previous command.
{
  error: Error: spawn /root/.npm/_npx/41eaf48ba153073a/node_modules/@asos/snyker/node_modules/.bin/snyk ENOENT
      at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
      at onErrorNT (node:internal/child_process:477:16)
      at processTicksAndRejections (node:internal/process/task_queues:83:21) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'spawn /root/.npm/_npx/41eaf48ba153073a/node_modules/@asos/snyker/node_modules/.bin/snyk',
    path: '/root/.npm/_npx/41eaf48ba153073a/node_modules/@asos/snyker/node_modules/.bin/snyk',
    spawnargs: [
      'test',
      '--dev',
      '--json',
      '--ignore-policy',
      '--strict-out-of-sync=true',
      '--file=yarn.lock',
      '--prune-repeated-dependencies'
    ]
  }
}
Retrying...
An error was thrown while executing the previous command.
{
  error: Error: spawn /root/.npm/_npx/41eaf48ba153073a/node_modules/@asos/snyker/node_modules/.bin/snyk ENOENT
      at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
      at onErrorNT (node:internal/child_process:477:16)
      at processTicksAndRejections (node:internal/process/task_queues:83:21) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'spawn /root/.npm/_npx/41eaf48ba153073a/node_modules/@asos/snyker/node_modules/.bin/snyk',
    path: '/root/.npm/_npx/41eaf48ba153073a/node_modules/@asos/snyker/node_modules/.bin/snyk',
    spawnargs: [
      'test',
      '--dev',
      '--json',
      '--ignore-policy',
      '--strict-out-of-sync=true',
      '--file=yarn.lock',
      '--prune-repeated-dependencies'
    ]
  }
}
Exiting...

This is as a result of the hardcorded path to the snyk binary, which is incorrect in npx contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant