tree-sitter-cli
我正在尝试使用最新的 npm安装包
❯ npm -v
8.6.0
但不断出现以下错误。
0 verbose cli ~/.local/bin/node-v16.17.1-linux-x64/bin/node ~/.local/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:~/.local/bin/node-v16.17.1-linux-x64/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 2ms
9 timing config:load:project Completed in 3ms
10 timing config:load:file:~/.npmrc Completed in 2ms
11 timing config:load:user Completed in 2ms
12 timing config:load:file:~/.local/bin/node-v16.17.1-linux-x64/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:validate Completed in 1ms
15 timing config:load:credentials Completed in 1ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 15ms
18 timing npm:load:configload Completed in 15ms
19 timing npm:load:mkdirpcache Completed in 1ms
20 timing npm:load:mkdirplogs Completed in 1ms
21 verbose title npm install tree-sitter-cli
22 verbose argv "install" "--global" "tree-sitter-cli" "--loglevel" "verbose"
23 timing npm:load:setTitle Completed in 0ms
24 timing config:load:flatten Completed in 2ms
25 timing npm:load:display Completed in 5ms
26 verbose logfile logs-max:10 dir:~/.local/npmcache/_logs
27 verbose logfile ~/.local/npmcache/_logs/2022-09-26T02_47_22_482Z-debug-0.log
28 timing npm:load:logFile Completed in 8ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 31ms
32 timing arborist:ctor Completed in 1ms
33 silly logfile start cleaning logs, removing 1 files
34 timing idealTree:init Completed in 5ms
35 timing idealTree:userRequests Completed in 2ms
36 silly idealTree buildDeps
37 silly fetch manifest tree-sitter-cli@*
38 silly logfile done cleaning log files
39 http fetch GET 200 https://registry.npmjs.org/tree-sitter-cli 20ms (cache hit)
40 silly placeDep ROOT [email protected] OK for: want: *
41 timing idealTree:#root Completed in 31ms
42 timing idealTree:node_modules/tree-sitter-cli Completed in 0ms
43 timing idealTree:buildDeps Completed in 32ms
44 timing idealTree:fixDepFlags Completed in 1ms
45 timing idealTree Completed in 41ms
46 timing reify:loadTrees Completed in 45ms
47 timing reify:diffTrees Completed in 1ms
48 silly reify moves {}
49 timing reify:retireShallow Completed in 1ms
50 timing reify:createSparse Completed in 3ms
51 timing reify:loadBundles Completed in 0ms
52 silly audit bulk request { 'tree-sitter-cli': [ '0.20.7' ] }
53 timing reifyNode:node_modules/tree-sitter-cli Completed in 30ms
54 timing reify:unpack Completed in 31ms
55 timing reify:unretire Completed in 0ms
56 timing build:queue Completed in 1ms
57 timing build:link:node_modules/tree-sitter-cli Completed in 0ms
58 timing build:link Completed in 1ms
59 info run [email protected] install node_modules/tree-sitter-cli node install.js
60 info run [email protected] install { code: 1, signal: null }
61 timing reify:rollback:createSparse Completed in 15ms
62 timing reify:rollback:retireShallow Completed in 0ms
63 timing command:install Completed in 291ms
64 verbose stack Error: command failed
64 verbose stack at ChildProcess.<anonymous> (~/.local/bin/node-v16.17.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
64 verbose stack at ChildProcess.emit (node:events:513:28)
64 verbose stack at maybeClose (node:internal/child_process:1093:16)
64 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
65 verbose pkgid [email protected]
66 verbose cwd ~/
67 verbose Linux 3.10.0-1160.71.1.el7.x86_64
68 verbose node v16.17.1
69 verbose npm v8.15.0
70 error code 1
71 error path ~/.local/bin/node-v16.17.1-linux-x64/lib/node_modules/tree-sitter-cli
72 error command failed
73 error command sh /tmp/install-3737b577.sh
74 error Downloading https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.7/tree-sitter-linux-x64.gz
75 error Download failed
75 error
75 error url: https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.7/tree-sitter-linux-x64.gz
75 error status: 400
75 error headers: {
75 error "cache-control": "no-cache",
75 error "pragma": "no-cache",
75 error "content-type": "text/html; charset=utf-8",
75 error "proxy-connection": "close",
75 error "connection": "close",
75 error "content-length": "727"
75 error }
76 verbose exit 1
77 timing npm Completed in 404ms
78 verbose unfinished npm timer reify 1664160442593
79 verbose unfinished npm timer reify:audit 1664160442650
80 verbose unfinished npm timer auditReport:getReport 1664160442650
81 verbose unfinished npm timer reify:build 1664160442684
82 verbose unfinished npm timer build 1664160442684
83 verbose unfinished npm timer build:deps 1664160442684
84 verbose unfinished npm timer build:run:install 1664160442688
85 verbose unfinished npm timer build:run:install:node_modules/tree-sitter-cli 1664160442688
86 verbose code 1
87 error A complete log of this run can be found in:
87 error ~/.local/npmcache/_logs/2022-09-26T02_47_22_482Z-debug-0.log
我使用了公司代理(代理设置是通过 shell 变量http_proxy
&设置的https_proxy
),并且 npm 正在使用代理设置
❯ npm ping
npm notice PING https://registry.npmjs.org/
npm notice PONG 819ms
这(node
&npm
)实际上不是我的专业领域,所以我需要帮助来理解和诊断错误。
我的 npm 配置是
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.
已更新:上述日志已更新新的错误。
答案1
尝试设置 npm 代理
npm config set proxy http://XXXXXXXXXXXXX
npm config set https-proxy http://XXXXXXXXXXXX
npm config set http-proxy http://XXXXXXXXXXXXXXX
npm i tree-sitter-cli