snyk / nodejs-lockfile-parser

Generate a Snyk dependency tree from package-lock.json or yarn.lock file
Other
57 stars 28 forks source link

fix: npm version parse test & enable logging #177

Closed lili2311 closed 1 year ago

lili2311 commented 1 year ago

What this does

Log the full error in debug mode when we fail to grab the lockfile version Add a test for the parsong function to show it works as expected on Node 12 Enable tests on Node 12 as CLI still supports Node 12

CleanShot 2023-02-20 at 18 59 15@2x

JamesPatrickGill commented 1 year ago

Done some digging and writing up findings:

The CLI is currently using snyk-nodejs-lockfile-parser at version 1.45.1. This uses an old version of this function - seen here.

This function is causing an issue as it is looking for an exact string "lockfileVersion: 1, - note the comma. The new function introduced should not have this issue, and so this will be fixed when we bump the CLI in this PR. I aim to get this merged very shortly.

Therefore I say we merge in this PR, the test is a very welcome addition and should have been here the whole time. Then alter the other PR to bump to the newest version - ready for it to be merged.

Thanks again :)

snyksec commented 1 year ago

:tada: This PR is included in version 1.47.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: