Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing on termux (Android) #4933

Closed
luisdavim opened this issue Mar 9, 2024 · 1 comment
Closed

Error when installing on termux (Android) #4933

luisdavim opened this issue Mar 9, 2024 · 1 comment

Comments

@luisdavim
Copy link

I'm getting an error when trying tto install coc on Android.

Reproduce the bug

Running npm ci results in the following error:

$ npm ci
[##################] - reify:typescript: timing reifyNode:node_modules/caniuse-lite Completed in 3409ms
> @swc/core@1.4.2 postinstall
> node postinstall.js

Error: Cannot find module '@swc/core-android-arm64'fyNode:node_modules/caniuse-lite Completed in 3409ms
Require stack:
- /data/data/com.termux/files/home/.vim/bundle/coc.nvim/node_modules/@swc/core/binding.js
- /data/data/com.termux/files/home/.vim/bundle/coc.nvim/node_modules/@swc/core/postinstall.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)
    at Module._load (node:internal/modules/cjs/loader:990:27)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/data/data/com.termux/files/home/.vim/bundle/coc.nvim/node_modules/@swc/core/binding.js:67:41)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at Module.require (node:internal/modules/cjs/loader:1237:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/data/data/com.termux/files/home/.vim/bundle/coc.nvim/node_modules/@swc/core/binding.js',
    '/data/data/com.termux/files/home/.vim/bundle/coc.nvim/node_modules/@swc/core/postinstall.js'
  ]
}
@swc/core was not able to resolve native bindings installation. It'll try to use @swc/wasm as fallback instead.
[##################] \ reify:typescript: timing reifyNode:node_modules/caniuse-lite Completed in 3409ms
> esbuild@0.17.19 postinstall
> node install.js


> coc.nvim-master@0.0.82 prepare
> node esbuild.js


added 559 packages, and audited 560 packages in 11s

83 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

I can get around it with:

$ npm i @swc/core-android-arm64

added 1 package, changed 1 package, and audited 562 packages in 4s

83 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

But I have to do that from the coc folder installing the package globaly is not enough.

@fannheyward
Copy link
Member

I didn't test with Termux, from the logs, swc couldn't install native binary but fallback to wasm one, the installation was completed to run npm run build, coc.nvim's building is successful.

I think this is caused with wrong version matching: coc.nvim wants to install @swc/core@1.4.2, but the @swc/core-android-arm64 is 1.3.11, https://www.npmjs.com/package/@swc/core-android-arm64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants