2

I am trying to install a package tree-sitter-cli using the latest npm

❯ npm -v
8.6.0

But keep getting the following error.

63 timing command:i Completed in 885ms
64 verbose stack Error: command failedche/_logs/2022-04-04T12_58_29_622Z-debug-0.log
64 verbose stack     at ChildProcess.<anonymous> (~/.local/lib/node_modules/npm/node_
modules/@npmcli/promise-spawn/index.js:64:27)
64 verbose stack     at ChildProcess.emit (node:events:527:28)
64 verbose stack     at maybeClose (node:internal/child_process:1090:16)
64 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
65 verbose pkgid tree-sitter-cli@0.20.6
66 verbose cwd /glb/home/innnei
67 verbose Linux 3.10.0-1160.53.1.el7.x86_64
68 verbose node v17.8.0
69 verbose npm  v8.6.0
70 error code 1
71 error path ~/.local/lib/node_modules/tree-sitter-cli
72 error command failed
73 error command sh -c node install.js
74 error Downloading https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.6/tree-sitter-linux-x64.gz
75 error node:events:505
75 error       throw er; // Unhandled 'error' event
75 error       ^
75 error
75 error Error: read ECONNRESET
75 error     at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
75 error Emitted 'error' event on ClientRequest instance at:
75 error     at TLSSocket.socketErrorListener (node:_http_client:454:9)
75 error     at TLSSocket.emit (node:events:527:28)
75 error     at emitErrorNT (node:internal/streams/destroy:164:8)
75 error     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
75 error     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
75 error   errno: -104,
75 error   code: 'ECONNRESET',
75 error   syscall: 'read'
75 error }
75 error
75 error Node.js v17.8.0
76 verbose exit 1
77 timing npm Completed in 1349ms
78 verbose unfinished npm timer reify 1649077110082
79 verbose unfinished npm timer reify:audit 1649077110203
80 verbose unfinished npm timer auditReport:getReport 1649077110203
81 verbose unfinished npm timer reify:build 1649077110257
82 verbose unfinished npm timer build 1649077110257
83 verbose unfinished npm timer build:deps 1649077110257
84 verbose unfinished npm timer build:run:install 1649077110261
85 verbose unfinished npm timer build:run:install:node_modules/tree-sitter-cli 1649077110262
86 verbose code 1

I am behind a corporate proxy (proxy setting is set through shell variables http_proxy & https_proxy ) and npm is working with the proxy settings

❯ npm ping
npm notice PING https://registry.npmjs.org/
npm notice PONG 819ms

This (node & npm) is not really my area of expertise, so I need help in understanding & diagnosing the error.

My npm config is

cache = "~/.local/npmcache"
registry = "https://registry.npmjs.org/"

; "cli" config from command line options

global = true

; node bin location = ~/.local/bin/node
; cwd = $HOME/innnei
; HOME = $HOME/innnei
; Run `npm config ls -l` to show all defaults.
DOOM
  • 1,170
  • 6
  • 20

1 Answers1

0

The problem happens when I tried to create a new app using npx create-react-app test-app

after some tries the problem got solved with this command.

npx clear-npx-cache

then after closing the visual studio code editor so that it releases some caches too.

this trick is from this answer

Give it a try.

Ruberandinda Patience
  • 3,435
  • 3
  • 20
  • 18
  • This did not resolve the issue for me. For some reason only the plugin `tree-sitter-cli` is causing the issue. Other packages from github work w/o any problem. Waiting for next release for now. – DOOM Jul 12 '22 at 05:58