npm install of cmake-js fails with '...ith ANSI escape codes #1393

Open
opened 2026-01-30 22:24:38 +00:00 by claunia · 0 comments
Owner

Originally created by @rkeithhill on GitHub (May 28, 2019).

Environment

Windows build number: 1903 18362.116
Windows Terminal version (if applicable): Build from Saturday, May 25th

Any other software? PowerShell Core 6.2.0 / ssh

Steps to reproduce

  1. ssh'd (using Windows OpenSSH client v7.7.2.1) to a Windows 10 machine running 1809. SSH user runs as admin on that box.
  2. Run npm install -g cmake-js

Expected behavior

No errors. Which is what I get if I ssh from a regular PowerShell Core (conhsot) console.

Actual behavior

Errors with:

PS> npm install -g cmake-js                                                                              
npm ERR! Unexpected end of JSON input while parsing near '...ith ANSI escape codes' 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mctcbld\AppData\Roaming\npm-cache\_logs\2019-05-28T21_42_46_235Z-debug.log 

The last (failing) part of the npm log is:

430 silly pacote range manifest for strip-ansi@^3.0.1 fetched in 541ms
431 silly resolveWithNewModule strip-ansi@3.0.1 checking installable status
432 timing stage:rollbackFailedOptional Completed in 1ms
433 timing stage:runTopLevelLifecycles Completed in 34700ms
434 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ith ANSI escape codes'
434 verbose stack     at JSON.parse (<anonymous>)
434 verbose stack     at parseJson (C:\Users\mctcbld\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better
-errors\index.js:7:17)
434 verbose stack     at consumeBody.call.then.buffer (C:\Users\mctcbld\AppData\Roaming\npm\node_modules\npm\node_module
s\node-fetch-npm\src\body.js:96:50)
434 verbose stack     at <anonymous>
434 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
435 verbose cwd C:\Users\mctcbld
436 verbose Windows_NT 10.0.17763
437 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mctcbld\\AppData\\Roaming\\npm\\node_modules\\npm\\bi
n\\npm-cli.js" "install" "-g" "cmake-js" "-f"
438 verbose node v8.11.4
439 verbose npm  v6.4.0
440 error Unexpected end of JSON input while parsing near '...ith ANSI escape codes'
441 verbose exit [ 1, true ]

I wouldn't normally think this a problem with Terminal except for the mention of "ANSI escape codes" and the fact that the install works in a regular console.

Originally created by @rkeithhill on GitHub (May 28, 2019). <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 1903 18362.116 Windows Terminal version (if applicable): Build from Saturday, May 25th Any other software? PowerShell Core 6.2.0 / ssh ``` # Steps to reproduce 1. ssh'd (using Windows OpenSSH client v7.7.2.1) to a Windows 10 machine running 1809. SSH user runs as admin on that box. 2. Run `npm install -g cmake-js` # Expected behavior No errors. Which is what I get if I ssh from a regular PowerShell Core (conhsot) console. # Actual behavior Errors with: ``` PS> npm install -g cmake-js npm ERR! Unexpected end of JSON input while parsing near '...ith ANSI escape codes' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\mctcbld\AppData\Roaming\npm-cache\_logs\2019-05-28T21_42_46_235Z-debug.log ``` The last (failing) part of the npm log is: ``` 430 silly pacote range manifest for strip-ansi@^3.0.1 fetched in 541ms 431 silly resolveWithNewModule strip-ansi@3.0.1 checking installable status 432 timing stage:rollbackFailedOptional Completed in 1ms 433 timing stage:runTopLevelLifecycles Completed in 34700ms 434 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ith ANSI escape codes' 434 verbose stack at JSON.parse (<anonymous>) 434 verbose stack at parseJson (C:\Users\mctcbld\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better -errors\index.js:7:17) 434 verbose stack at consumeBody.call.then.buffer (C:\Users\mctcbld\AppData\Roaming\npm\node_modules\npm\node_module s\node-fetch-npm\src\body.js:96:50) 434 verbose stack at <anonymous> 434 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7) 435 verbose cwd C:\Users\mctcbld 436 verbose Windows_NT 10.0.17763 437 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mctcbld\\AppData\\Roaming\\npm\\node_modules\\npm\\bi n\\npm-cli.js" "install" "-g" "cmake-js" "-f" 438 verbose node v8.11.4 439 verbose npm v6.4.0 440 error Unexpected end of JSON input while parsing near '...ith ANSI escape codes' 441 verbose exit [ 1, true ] ``` I wouldn't normally think this a problem with Terminal except for the mention of "ANSI escape codes" and the fact that the install works in a regular console.
claunia added the Issue-BugArea-VTResolution-ExternalProduct-Meta labels 2026-01-30 22:24:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1393