snyk protect: vulns.forEach is not a function

Created on 29 Nov 2016  路  4Comments  路  Source: snyk/snyk

  • node -v: 7.0.0
  • npm -v: 4.0.2
  • snyk -v: 1.21.0
  • Command run: snyk protect

Expected behaviour

$ ./node_modules/.bin/snyk protect

Successfully applied Snyk patches

Actual behaviour

$ ./node_modules/.bin/snyk protect
- Querying vulnerabilities database...
vulns.forEach is not a function

Steps to reproduce

$ npm install
# (runs ./node_modules/.bin/snyk protect in prepublish)

If applicable, please append the --debug flag on your command and include the output here **ensuring to remove any sensitive/personal details or tokens.

$ ./node_modules/.bin/snyk protect --debug
  snyk protect +0ms { _: [ [Circular] ], debug: true }
  snyk ~~~~ LIVE RUN ~~~~ +482ms
  snyk checking for cli updates +4ms
  snyk add +45ms local true
  snyk policies found +1s [ '/Users/clay/Projects/matrix',
  '/Users/clay/Projects/matrix/node_modules/snyk' ]
  snyk add +0ms policies 2
  snyk add +5ms packageName @smockle/matrix
  snyk add +0ms packageVersion 1.0.1
  snyk add +0ms package @smockle/[email protected]
  snyk add +356ms vulns-pre-policy 0..
  snyk add +4ms vulns 0
  snyk add +6ms success false
  snyk add +0ms error-message vulns.forEach is not a function
  snyk add +1ms error TypeError: vulns.forEach is not a function
    at /Users/clay/Projects/matrix/node_modules/snyk/lib/protect/patch.js:50:11
    at tryCatch (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:410:12)
    at invokeCallback (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:425:13)
    at publish (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:393:7)
    at flush (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:121:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  snyk add +0ms error-code undefined
  snyk add +0ms command protect
TypeError: vulns.forEach is not a function
    at /Users/clay/Projects/matrix/node_modules/snyk/lib/protect/patch.js:50:11
    at tryCatch (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:410:12)
    at invokeCallback (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:425:13)
    at publish (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:393:7)
    at flush (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:121:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  snyk { command: 'bad-command', args: [ { debug: true } ], metadata: { local: true, policies: 2, packageName: '@smockle/matrix', packageVersion: '1.0.1', package: '@smockle/[email protected]', 'vulns-pre-policy': 0, vulns: 0, success: false, 'error-message': 'vulns.forEach is not a function', error: 'TypeError: vulns.forEach is not a function\n    at /Users/clay/Projects/matrix/node_modules/snyk/lib/protect/patch.js:50:11\n    at tryCatch (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:410:12)\n    at invokeCallback (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:425:13)\n    at publish (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:393:7)\n    at flush (/Users/clay/Projects/matrix/node_modules/es6-promise/dist/es6-promise.js:121:5)\n    at _combinedTickCallback (internal/process/next_tick.js:67:7)\n    at process._tickCallback (internal/process/next_tick.js:98:9)', 'error-code': undefined, command: 'protect' }, version: '1.21.0', os: 'OS X', nodeVersion: 'v7.0.0', id: '<snip>', ci: false } +5ms
bug

Most helpful comment

Hi all, this issue has been resolved in version 1.21.1, available now via npm. Thanks for your patience!

All 4 comments

Thanks for reporting this, we're looking into it and will report back on this thread.

Thanks! For additional context, here is the output of test runs that failed with this error: https://travis-ci.org/smockle/matrix. Code is public here: https://github.com/smockle/matrix.

Thanks @smockle. The problem was related to the changes in the 1.21.0 release earlier today. A fix has been applied and is busy working its way through our CI, it should be released shortly.

Hi all, this issue has been resolved in version 1.21.1, available now via npm. Thanks for your patience!

Was this page helpful?
0 / 5 - 0 ratings