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

TypeError on initial run #60

Closed
karesztrk opened this issue Mar 8, 2023 · 3 comments
Closed

TypeError on initial run #60

karesztrk opened this issue Mar 8, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@karesztrk
Copy link

Sandworm version
1.27.0

Describe the bug
I'm receiving the following error on the first try of any project on any node version (12, 14, 18).

TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at generateNpmGraph (/home/ktorok/.nvm/versions/node/v14.21.3/lib/node_modules/@sandworm/audit/src/graph/generateNpmGraph.js:14:10)
    at generateGraphPromise (/home/ktorok/.nvm/versions/node/v14.21.3/lib/node_modules/@sandworm/audit/src/graph/index.js:17:19)
    at async getReport (/home/ktorok/.nvm/versions/node/v14.21.3/lib/node_modules/@sandworm/audit/src/index.js:41:25)
    at async Object.handler (/home/ktorok/.nvm/versions/node/v14.21.3/lib/node_modules/@sandworm/audit/src/cli/index.js:36:7)

To Reproduce
Run sandworm-audit

Expected behavior
Give me any output without error.

Node (please complete the following information):

  • Version 12, 14, 18
  • OS: Garuda Linux
@karesztrk karesztrk added the bug Something isn't working label Mar 8, 2023
@gabidobo
Copy link
Member

gabidobo commented Mar 8, 2023

@karesztrk thanks for reporting this!

Could you please check your package-lock.json file and tell me what your lockfileVersion is? We currently support lockfileVersion >= 2 and it sounds like yours might be version 1.

We need to do better error messaging around this, I've published v1.28.0 that should log a better error if that's the case - you can try it out with npx @sandworm/audit@latest to force npm to get the latest version.

@karesztrk
Copy link
Author

@gabidobo You are correct. I have a version "lockfileVersion": 1. I did not notice that it was a mandatory thing. Thanks for the clarification.

@gabidobo
Copy link
Member

gabidobo commented Mar 8, 2023

@karesztrk thank you for bringing this up! I'll also update the docs to highlight these requirements better.
Closing this now.

@gabidobo gabidobo closed this as completed Mar 8, 2023
@karesztrk karesztrk changed the title Typeerror on initial run TypeError on initial run Mar 8, 2023
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

No branches or pull requests

2 participants