Skip to content

SyntaxError when reading package.json #739

@satoridev01

Description

@satoridev01

Describe the bug
There is a SyntaxError when parsing a couple of repos:

SyntaxError: /data/package.json: ...
    at JSON.parse (<anonymous>)
    at readFileSync (/usr/local/lib/node_modules/jscpd/node_modules/jsonfile/index.js:52:17)
    at readPackageJsonConfig (/usr/local/lib/node_modules/jscpd/dist/jscpd.js:134:40)
    at prepareOptions (/usr/local/lib/node_modules/jscpd/dist/jscpd.js:144:29)
    at initOptionsFromCli (/usr/local/lib/node_modules/jscpd/dist/jscpd.js:167:19)
    at jscpd (/usr/local/lib/node_modules/jscpd/dist/jscpd.js:321:19)
    at /usr/local/lib/node_modules/jscpd/dist/jscpd.js:351:11
    at Object.<anonymous> (/usr/local/lib/node_modules/jscpd/dist/jscpd.js:356:3)
    at Module._compile (node:internal/modules/cjs/loader:1760:14)
    at Object..js (node:internal/modules/cjs/loader:1893:10)

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo
  2. jscpd .

Screenshots

Image

https://satori.ci/search/?playbook=satori%3A%2F%2Fcode%2Fjavascript%2Flint%2Fjscpd.yml&report_visibility=Public-Global&query=%28SyntaxError%29

Desktop (please complete the following information):

  • OS: latest node docker image
  • jscpd version: latest jscpd npm version

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