Skip to content

errors when running auto command without argument #673

@ErwanRaulo

Description

@ErwanRaulo

version

cli 3.1.0
node 24

command

nsecure auto

issue

optional dependency [dep] as argument throws errors like those in the attached file

cli-issue.txt

  • investigate, but we should at least pretty print TypeError without stack trace, for example:
error name: tarball.scanDirOrArchive bare-os@3.7.1
Message: Cannot read properties of undefined (reading 'get')
The error occured during the tarball-scan phase
The error occured at 9ms during the execution
Stack: TypeError: Cannot read properties of undefined (reading 'get')
    at AstAnalyser.getCollectableSet (@nodesecure/tarball/node_modules/@nodesecure/js-x-ray/dist/AstAnalyser.js:219:45)
    at #analyseFile (@nodesecure/tarball/node_modules/@nodesecure/js-x-ray/dist/EntryFilesAnalyser.js:86:48)
    at #analyseFile.next (<anonymous>)
    at EntryFilesAnalyser.analyse (@nodesecure/tarball/node_modules/@nodesecure/js-x-ray/dist/EntryFilesAnalyser.js:46:37)
    at analyse.next (<anonymous>)
    at #iterateWithEntries (@nodesecure/tarball/dist/class/SourceCodeScanner.class.js:58:26)
    at async NpmTarball.scanFiles (@nodesecure/tarball/dist/class/NpmTarball.class.js:41:20)
    at async scanDirOrArchive (@nodesecure/tarball/dist/tarball.js:24:48)
    at async scanDirOrArchiveEx (@nodesecure/scanner/dist/depWalker.js:309:5)
    at async Promise.allSettled (index 1124)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions