npm install error on termux
Describe the bug
npm ERR! code FETCH_ERROR npm ERR! errno FETCH_ERROR npm ERR! invalid json response body at https://registry.npmjs.org/netlify-cli reason: Invalid response body while trying to fetch https://registry.npmjs.org/netlify-cli: EACCES: permission denied, link '/data/data/com.termux/files/home/.npm/_cacache/tmp/6abcf009' -> '/data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/7f/9a/042d49b88ee5a2396a4975cd40bb74569275cb475d96beaeaea2552b3a5908afca5b6764eccde7a1d6e017096491f58ffb9ff703e7cbe8563bcd5a500642'
npm ERR! A complete log of this run can be found in: npm ERR! /data/data/com.termux/files/home/.npm/_logs/2022-09-04T13_16_58_143Z-debug-0.log
Steps to reproduce
$ npm i netlify-cli -g
Configuration
No response
Environment
termux
Same issue during install @vue/cli
i tried a suggestion, but still not work :
npm clean cache --force
Same here, package nodejs 18.7.0-1, (updated) npm 8.19.1.
I tried to downgrade npm:
pkg reinstall nodejs
npm --version
8.15.0
And it helped.
i'm installing @vue/cli via npm. It worked when using node v16.17.0 (npm v8.15.0). My device is pop os.
I have the same problem when using npx create-react-app
I have the same issue when running:
npx create-react-app my-app
error message:
npm ERR! invalid json response body at https://registry.npmjs.org/create-react-app reason: Invalid response body while trying to fetch https://registry.npmjs.org/create-react-app: EACCES: permission denied
I got the same problem creating a new react app today and used sudo and worked for me
sudo create-react-app my-app
Same issue during install @vue/cli
i tried a suggestion, but still not work :
npm clean cache --force
@ztroy this doesnt work
~ $ npm cache clean --force
npm WARN using --force Recommended protections disabled.
~ $ npm install cow
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/cow reason: Invalid response body while trying to fetch https://registry.npmjs.org/cow: EACCES: permission denied, link '/data/data/com.termux/files/home/.npm/_cacache/tmp/a19e28a0' -> '/data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/41/81/c952d913acc8e67ac77d7afe12399c38be29337f48d462184222f3660f66321636bd453cd61b08c82df6e7f1999fd379928585323a840ee0234e01dec182'
npm ERR! A complete log of this run can be found in:
npm ERR! /data/data/com.termux/files/home/.npm/_logs/2022-10-11T12_53_18_256Z-debug-0.lo
log file
0 verbose cli /data/data/com.termux/files/usr/bin/node /data/data/com.termux/files/usr/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 7ms
5 timing config:load:file:/data/data/com.termux/files/usr/lib/node_modules/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 5ms
8 timing config:load:env Completed in 1ms
9 timing config:load:project Completed in 5ms
10 timing config:load:file:/data/data/com.termux/files/home/.npmrc Completed in 3ms
11 timing config:load:user Completed in 5ms
12 timing config:load:file:/data/data/com.termux/files/usr/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 2ms
14 timing config:load:validate Completed in 2ms
15 timing config:load:credentials Completed in 3ms
16 timing config:load:setEnvs Completed in 3ms
17 timing config:load Completed in 42ms
18 timing npm:load:configload Completed in 43ms
19 timing npm:load:mkdirpcache Completed in 4ms
20 timing npm:load:mkdirplogs Completed in 2ms
21 verbose title npm install cow
22 verbose argv "install" "cow"
23 timing npm:load:setTitle Completed in 4ms
24 timing config:load:flatten Completed in 10ms
25 timing npm:load:display Completed in 18ms
26 verbose logfile logs-max:10 dir:/data/data/com.termux/files/home/.npm/_logs
27 verbose logfile /data/data/com.termux/files/home/.npm/_logs/2022-10-11T12_53_18_256Z-debug-0.log
28 timing npm:load:logFile Completed in 22ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 98ms
32 timing arborist:ctor Completed in 3ms
33 silly logfile start cleaning logs, removing 1 files
34 silly logfile done cleaning log files
35 timing idealTree:init Completed in 346ms
36 timing idealTree:userRequests Completed in 6ms
37 silly idealTree buildDeps
38 silly fetch manifest cow@*
39 timing arborist:ctor Completed in 1ms
40 http fetch GET 200 https://registry.npmjs.org/cow 763ms (cache miss)
41 silly placeDep ROOT cow@ OK for: want: *
42 timing idealTree:#root Completed in 789ms
43 timing idealTree:node_modules/cow Completed in 1ms
44 timing idealTree:buildDeps Completed in 793ms
45 timing idealTree:fixDepFlags Completed in 3ms
46 timing idealTree Completed in 1154ms
47 timing command:install Completed in 1202ms
48 verbose type invalid-json
49 verbose stack FetchError: invalid json response body at https://registry.npmjs.org/cow reason: Invalid response body while trying to fetch https://registry.npmjs.org/cow: EACCES: permission denied, link '/data/data/com.termux/files/home/.npm/_cacache/tmp/a19e28a0' -> '/data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/41/81/c952d913acc8e67ac77d7afe12399c38be29337f48d462184222f3660f66321636bd453cd61b08c82df6e7f1999fd379928585323a840ee0234e01dec182'
49 verbose stack at Response.json (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/body.js:79:13)
49 verbose stack at async RegistryFetcher.packument (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:99:25)
49 verbose stack at async RegistryFetcher.manifest (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/pacote/lib/registry.js:124:23)
49 verbose stack at async [nodeFromEdge] (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1061:19)
49 verbose stack at async [buildDepStep] (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:930:11)
49 verbose stack at async Arborist.buildIdealTree (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:211:7)
49 verbose stack at async Promise.all (index 1)
49 verbose stack at async Arborist.reify (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:153:5)
49 verbose stack at async Install.exec (/data/data/com.termux/files/usr/lib/node_modules/npm/lib/commands/install.js:145:5)
49 verbose stack at async module.exports (/data/data/com.termux/files/usr/lib/node_modules/npm/lib/cli.js:78:5)
50 verbose cwd /data/data/com.termux/files/home
51 verbose Linux 4.9.186-perf-g131f907
52 verbose node v18.10.0
53 verbose npm v8.19.2
54 error code FETCH_ERROR
55 error errno FETCH_ERROR
56 error invalid json response body at https://registry.npmjs.org/cow reason: Invalid response body while trying to fetch https://registry.npmjs.org/cow: EACCES: permission denied, link '/data/data/com.termux/files/home/.npm/_cacache/tmp/a19e28a0' -> '/data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/41/81/c952d913acc8e67ac77d7afe12399c38be29337f48d462184222f3660f66321636bd453cd61b08c82df6e7f1999fd379928585323a840ee0234e01dec182'
57 verbose exit 1
58 timing npm Completed in 1971ms
59 verbose unfinished npm timer reify 1665492799008
60 verbose unfinished npm timer reify:loadTrees 1665492799041
61 verbose code 1
62 error A complete log of this run can be found in:
62 error /data/data/com.termux/files/home/.npm/_logs/2022-10-11T12_53_18_256Z-debug-0.log
This fixed it. Thank you (Imagine updating things without thinking it would break :) )
Hi, I have the same issue, tried everything but nothing works. Note that I am in Windows and I try running the terminal as administrator but with no avail.
Please report this to termux or npm. I don't think we can do anything about this in the netlify-cli here.
/data/data/com.termux/files/usr/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:81
throw new Error(`Unsupported platform: ${platformKey}`);
^
Error: Unsupported platform: android arm LE
at pkgAndSubpathForCurrentPlatform (/data/data/com.termux/files/usr/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:81:11)
at checkAndPreparePackage (/data/data/com.termux/files/usr/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:220:28)
at Object.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:247:1)
at Module._compile (node:internal/modules/cjs/loader:1149:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1203:10)
at Module.load (node:internal/modules/cjs/loader:1027:32)
at Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Latest version