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

Cannot convert undefined or null to object Exiting #247

Closed
agnosticcloud opened this issue Apr 8, 2022 · 9 comments · Fixed by #258
Closed

Cannot convert undefined or null to object Exiting #247

agnosticcloud opened this issue Apr 8, 2022 · 9 comments · Fixed by #258
Labels
bug Something isn't working

Comments

@agnosticcloud
Copy link

This is the output of the audit-ci

audit-ci --config=audit-ci.json 2$>audit-report.json

[31mCannot convert undefined or null to object�[0m
[31mExiting...�[0m

These are the versions

Audit-ci: 5.1.2
NPM: 8.5.0
Nodejs: v16.14.1

Can you please confirm if the NPM/Nodejs versions are compatible with the audit-ci version? Let me know if you need any additional details. Thanks in advance.

@quinnturner
Copy link
Member

quinnturner commented Apr 8, 2022

Do you have a lockfile?

Also, please consider updating to the latest audit-ci, especially since you're using NPM v8. It's pretty much a rewrite of the dependency management algorithm and is pretty much required nowadays.

@quinnturner quinnturner added the question Further information is requested label Apr 8, 2022
@agnosticcloud
Copy link
Author

Yes we have a lockfile, and we are also running into this error when using the latest version of audit-ci.

@quinnturner
Copy link
Member

Do you have private dependencies?

Is it possible for you to email me the package.json and lockfile? You can remove the name of the project; I'd like a reproduction to help understand where the issue occurs. quinnDOTturnerATuwaterlooDOTca

@1sherlynn
Copy link

1sherlynn commented May 13, 2022

Are there any updates/findings on this? Also facing a similar issue.
When using node v12 and npm v6.14.15, this issue is not present.

Issue:

audit-ci version: 6.0.0
Cannot convert undefined or null to object
Exiting...

Versions used which is associated with the issue:

Audit-ci: 6.2.0 (latest at the moment)
NPM: 8.1.2
Nodejs: v16.13.2

@quinnturner
Copy link
Member

Thank you @1sherlynn for the report! Good to know that it's still occurring and that it's on NPM 8. Hoping you can post the result of this command: npm audit --json

@aarbro
Copy link

aarbro commented May 16, 2022

We were having the same issue after upgrading to node 16 and audit-ci 6.2.x.

I just figured out that we had a private registry in the project's .npmrc file. Once I overrode the registry to the default via the audit-ci command line (e.g. audit-ci --registry https://registry.npmjs.org), I no longer got the error. Setting it in the audit-ci config file worked also.

You can reproduce the error by simply specifying a bogus registry (e.g. audit-ci --registry http://localhost).

@quinnturner It would be great to get a fix for this, as it has caused lots of confusion!

@quinnturner
Copy link
Member

Thanks for the heads up @aarbro, will look into it and mark this as a bug!

@quinnturner quinnturner added bug Something isn't working and removed question Further information is requested labels May 16, 2022
quinnturner added a commit to quinnturner/audit-ci that referenced this issue May 17, 2022
@quinnturner
Copy link
Member

PR to resolve the registry issue @aarbro mentioned (and might catch other NPM 7+ related issues): #258

@quinnturner
Copy link
Member

Released in 6.2.1. If you're still having this issue, please message!

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.

4 participants