Error while using this github action (ErrorEXError [JSONError]: Unexpected token)
See original GitHub issueI am trying to use this action in my private repo but I run into an error like below during the execution of the workflow. The error is very long. Here I am providing the gist of it.
The end of the error is like so
ErrorEXError [JSONError]: Unexpected token } in JSON at position 142 while parsing near '...ear --port 8000", }, "devDependencie...' in package.json
at e.exports (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:82368)
at parse (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:51821)
at Function.e.exports.sync (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:51924)
at Function.sync (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:83199)
at Signale.get packageConfiguration [as packageConfiguration] (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:116193)
at new Signale (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:115057)
at Object.528 (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:88739)
at __nccwpck_require__ (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:517248)
at Object.5140 (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:1:142510)
at __nccwpck_require__ (/home/runner/work/_actions/EndBug/add-and-commit/v9/lib/index.js:7:517248) {
fileName: 'package.json'
}
Can you please let me know how to get this working? Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[Bug] Unexpected token i in JSON at position 1 #2567 - GitHub
Azure DevOps task fails with error Unexpected token i in JSON at position 1 even though GitVersion seems to complete successfully. Tried running ......
Read more >Errors of Unexpected token in JSON at position XXX while ...
I npm install on a directory with a package.json for my company project. However, it keeps giving me various errors of Unexpected token...
Read more >Unexpected token < in JSON at position 0 - Dave Ceddia
Read on for a quick suggestion, and watch the video for a walkthrough of a few techniques you ... How to fix Unexpected...
Read more >“syntax error unexpected end of json input pareserror” Code ...
Open Windows Powershell as admin npm cache clean --force solved the problem for me Alternative : You can use yarn instead npm install...
Read more >JSONError: Unexpected token '<' at 1:1 <!DOCTYPE html>
I have an endpoint, that by design is returning text/html formatted code. I have my test in postman setup with the requisite Accept...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@EndBug fwiw it looks like the action reads and validates a
package.json
in the workdir if there is one? Mypackage.json
was invalid (extra comma somewhere), fixing it stopped this bug from happening.@martijnarts I ended up adding the below code directly to my GitHub action
I my case, I use a Linux runner for this github actions. Also, I just create 1 file (that too in the action itself) and then I want to commit & push it so
git add .
works just fine. If you want to control precisely (add & commit a specific file for example), the nyou may want to tinker with the code above.