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

Invalid package.json: JSONParseError: Unexpected end of JSON input while parsing empty string #512

Closed
doug-wade opened this issue Dec 3, 2023 · 0 comments · Fixed by #594
Labels
bug Something isn't working cli

Comments

@doug-wade
Copy link
Owner

» npx @tybalt/cli scaffold eleventy --name dougwade.io
Need to install the following packages:
@tybalt/[email protected]
Ok to proceed? (y) y
npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated [email protected]: Use your platform's native DOMException instead
stdout:

Wrote to /Users/doug/code/dougwade.io/dougwade.io/package.json:

{
  "name": "dougwade.io",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}




installing dependencies; there may be errors
adding the following scripts to package.json
    test: run the unit tests
    build: build the static website
    serve: serve the local development website


node:internal/errors:932
  const err = new Error(message);
              ^

Error: Command failed: npm pkg set 'scripts.test'='jest'
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Invalid package.json: JSONParseError: Unexpected end of JSON input while parsing empty string
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in: /Users/doug/.npm/_logs/2023-12-03T18_13_06_006Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:514:28)
    at Pipe.<anonymous> (node:net:337:12) {
  code: 1,
  killed: false,
  signal: null,
  cmd: "npm pkg set 'scripts.test'='jest'",
  stdout: '',
  stderr: 'npm ERR! code EJSONPARSE\n' +
    'npm ERR! JSON.parse Invalid package.json: JSONParseError: Unexpected end of JSON input while parsing empty string\n' +
    'npm ERR! JSON.parse Failed to parse JSON data.\n' +
    'npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.\n' +
    '\n' +
    'npm ERR! A complete log of this run can be found in: /Users/doug/.npm/_logs/2023-12-03T18_13_06_006Z-debug-0.log\n'
}

Node.js v20.10.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant