-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Unable to download swc package - Next.js project in Android Termux #58483
Comments
I also have that issue. NextJS was working perfectly before version 14 now I get this error: ⨯ Failed to download swc package from https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-14.0.3.tgz |
@budchirp do you got solution |
@vercel fix it |
I'm getting the same 404 error when in ubuntu 22 proot termux. |
I also have this problem on Linux Bookworm with Bash terminal. The url that gets the 404 is https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-14.0.4.tgz |
Install rust |
I inderstand swc is built with rust but that does not help, I've installed rust and the project still gets the 404 |
Works for me, just install rust in any termux proot with |
This is what I get: root@localhost:~/projects/next-canvas# yarn build Downloading swc package @next/swc-android-arm64... |
what your node & npm version? I use proot-ubuntu and works fine. |
Try npm in proot debian or Ubuntu |
if you use Proot, install nodejs and npm latest version using nvm. |
bro this doesn't work in termux android |
install proot-distro in Termux then. |
Thanks the answer was to use proot and installed nvm, then cd into your next.js project and create an .nvmrc with the version of node. You can use |
proot should not be the solution. more libraries and tools should support Android. |
Looking at the @next/swc-android-arm64 package on the NPM registry, the latest version is 13.2.4. This appears to be tied to the NextJS version. If you downgrade to that NextJS version, the download should be successful. Looks like the releases are usually published by the vercel-release-bot, so someone from Vercel will likely need to have this built and published for the 14.x releases. |
Does the Android device have to be rooted ? |
to install proot-distro? nope! |
@clee231 I've also come to the same conclusion Do you know what should we do to notify the maintainers of vercel to build those packages? |
@vercel team please respond |
Just run following command it Will fix the issue npm i @next/swc-android-arm64 |
What about cpu which are arm only not arm64 |
Hi I tried nextjs 15.0.0-rc and next installed |
I don't think this is the right answer, but if you're developing in a local environment and want to get it up and running on Termux, build it locally, transfer it to something like SCP, and run it into production on Termux. npm run build
scp -P <PORT> -r .next public package.json package-lock.json id@ip://... Here's the script we ran on Termux npm i --omit=dev
npm run start My package.json looks like this {
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "^15.0.0-rc.0",
"react": "^19.0.0-rc-6230622a1a-20240610",
"react-dom": "^19.0.0-rc-6230622a1a-20240610"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "^15.0.0-rc.0",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
} |
THT IS NOT WORKING FOR ME BECAUSE IT IS ATTEMPTING TO INSTAL next/sws-andriod-arm64 also
If I install sws-andriod-arm64 then the issue is it doesn't support |
Working and tested solution: using Ubuntu Install Ubuntu:
After installation login to Ubuntu and do the npx stuff. Edit: |
@Jobians , thanks a lot for giving me a solution. It means a lot to me . |
Plz kindly reopen this the issues |
@anishdevtech Bro, this issue isn't related to Next.js or Vercel. The problem lies with the Rust compiler package required by Termux, which can't run directly on Termux. That's why I installed Ubuntu. |
Hi @anishdevtech I have the same issue with you. I followed this instruction: https://nextjs.org/docs/messages/failed-loading-swc But I failed. I want to know why nextjs still try to load SWC even though I have already disabled SWC by setting next.config.js |
I will look into this issue |
Here are the steps
4 . Movement of truth
|
I didn't use turbo package, it wasn't available on termux |
@anishdevtech |
Turbopack can be used for faster local development. If it causing problem remove // Before
{
"scripts": {
"dev": "next dev --turbo"
}
}
// After
{
"scripts": {
"dev": "next dev"
} |
The solution is to install a linux distribution using
pkg install proot-distro
proot-distro install ubuntu
proot-distro login ubuntu
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
exit
proot-distro login ubuntu
nvm install 20
|
This work perfectly for me, thanks alot |
I use this method and make it successful! Thanks. |
Tyyyyyyyy❤️❤️ |
Link to the code that reproduces this issue
https://github.com/Clever-Shivanshu/file-upload-api
To Reproduce
Current vs. Expected behavior
I am getting trying to create a api which takes files and save in public/uploads
But when go to
http://localhost:3000/api/fileUpload
It crashes and getting this
`$ npm run dev
▲ Next.js 14.0.2
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
✓ Ready in 5.6s
⚠ Attempted to load @next/swc-android-arm64, but it was not installed
⚠ Found lockfile missing swc dependencies, patching...
⨯ Failed to patch lockfile, please try uninstalling and reinstalling next in this workspace
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11522:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchPkgInfo (/data/data/com.termux/files/home/file-upload-api/node_modules/next/dist/lib/patch-incorrect-lockfile.js:64:17)
at async Promise.all (index 0)
at async patchIncorrectLockfile (/data/data/com.termux/files/home/file-upload-api/node_modules/next/dist/lib/patch-incorrect-lockfile.js:160:26) {
cause: Error [ERR_SOCKET_CONNECTION_TIMEOUT]: Socket connection timeout
at new NodeError (node:internal/errors:399:5)
at internalConnectMultiple (node:net:1099:20)
at Timeout.internalConnectMultipleTimeout (node:net:1638:3)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7) {
code: 'ERR_SOCKET_CONNECTION_TIMEOUT'
}
}
⨯ Failed to load SWC binary for android/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc`
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
SWC minifier (swcMinify: true)
Additional context
I tried to fix it but not working
The text was updated successfully, but these errors were encountered: