Skip to content

SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) #66

@dav1app

Description

@dav1app

For anyone that faces this issue, try updating to Node 16 and run the command again. You can just use it for this command, and then go back to your version!

There is an issue with this particular line:

// src/helper.js: 61:71
var getDependencyTree = function getDependencyTree() {
    var result = syncExec('npm ls --json ' + productionModifier);
    return JSON.parse(result.stdout).dependencies;
};

The problem is that syncExec uses a child_process.exec to execute the npm command, and depending on the size of the output, it might break due to the restrictions of the buffer size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions