js-kyle / js-kyle/npm-viewscripts

Fail with SyntaxError: Unexpected end of JSON input

Open
#12 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Description

   ➜  npx npm-viewscripts
Need to install the following packages:
  npm-viewscripts
Ok to proceed? (y) y

No potentially unsafe scripts found.
undefined:1


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /home/username/.npm/_npx/b4f17dfd428193b3/node_modules/npm-viewscripts/index.js:12:22
    at directoryTree (/home/cherrytea/.npm/_npx/b4f17dfd428193b3/node_modules/directory-tree/lib/directory-tree.js:108:7)
    at /home/username/.npm/_npx/b4f17dfd428193b3/node_modules/directory-tree/lib/directory-tree.js:121:21
    at Array.map (<anonymous>)
    at directoryTree (/home/cherrytea/.npm/_npx/b4f17dfd428193b3/node_modules/directory-tree/lib/directory-tree.js:121:8)
    at /home/username/.npm/_npx/b4f17dfd428193b3/node_modules/directory-tree/lib/directory-tree.js:121:21
    at Array.map (<anonymous>)
    at directoryTree (/home/cherrytea/.npm/_npx/b4f17dfd428193b3/node_modules/directory-tree/lib/directory-tree.js:121:8)
    at /home/username/.npm/_npx/b4f17dfd428193b3/node_modules/directory-tree/lib/directory-tree.js:121:21
   
➜  node -v
v16.4.1

➜ npm -v
7.19.1
   

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported npx npm-viewscripts failure with Node 16.4.1 and npm 7.19.1, then inspect index.js at line 12 where the stack trace shows JSON.parse failing. Done means the reported project no longer exits with an uncaught SyntaxError when no potentially unsafe scripts are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.