termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
31.27k stars 3.32k forks source link

[Bug]:in nodejs cant install sqlite3, node-gyp #3912

Closed Nekoplex closed 1 month ago

Nekoplex commented 1 month ago

Problem description

This is when i try to yarn add node-gyp error An unexpected error occurred: "EACCES: permission denied, symlink '../../../../semver/bin/semver.js' -> '/storage/emulated/0/testjs/node_modules/@npmcli/fs/node_modules/.bin/semver'". info If you think this is a bug, please open a bug report with the information provided in "/storage/emulated/0/testjs/yarn-error.log".

This is when I try to npm install node-gyp npm ERR! code EACCES npm ERR! syscall symlink npm ERR! path ../glob/dist/esm/bin.mjs npm ERR! dest /storage/emulated/0/testjs/node_modules/.bin/glob npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, symlink '../glob/dist/esm/bin.mjs' -> '/storage/emulated/0/testjs/node_modules/.bin/glob' npm ERR! [Error: EACCES: permission denied, symlink '../glob/dist/esm/bin.mjs' -> '/storage/emulated/0/testjs/node_modules/.bin/glob'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'symlink', npm ERR! path: '../glob/dist/esm/bin.mjs', npm ERR! dest: '/storage/emulated/0/testjs/node_modules/.bin/glob' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2024-04-08T14_39_29_635Z-debug-0.log

This is when I try to yarn add sqlite3 warning sqlite3 > node-gyp > make-fetch-happen > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs [2/4] Fetching packages... [3/4] Linking dependencies... error An unexpected error occurred: "EACCES: permission denied, symlink '../../../../semver/bin/semver.js' -> '/storage/emulated/0/testjs/node_modules/@npmcli/fs/node_modules/.bin/semver'".

And "npm install sqlite3 "

npm ERR! code EACCES npm ERR! syscall symlink npm ERR! path ../mkdirp/bin/cmd.js npm ERR! dest /storage/emulated/0/testjs/node_modules/.bin/mkdirp npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, symlink '../mkdirp/bin/cmd.js' -> '/storage/emulated/0/testjs/node_modules/.bin/mkdirp' npm ERR! [Error: EACCES: permission denied, symlink '../mkdirp/bin/cmd.js' -> '/storage/emulated/0/testjs/node_modules/.bin/mkdirp'] { npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'symlink', npm ERR! path: '../mkdirp/bin/cmd.js', npm ERR! dest: '/storage/emulated/0/testjs/node_modules/.bin/mkdirp' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: /data/data/com.termux/files/home/.npm/_logs/2024-04-08T14_42_19_373Z-debug-0.log Rust ,clang ,cmake etc. is installed I also tried to install with "fakeroot" and "su" Still getting errors. I checked other issues and methods from there doesn't work.

Also my friend has a bit another error When he tries to install these packages he gets error that he needs android-ndk-path. But he had errors same as mine too.

Steps to reproduce the behavior.

apt update apt upgrade apt install coreutils pkg install nodejs pkg install make pkg install clang npm install -g node-gyp (or "Npm install node-gyp")

Yarn add node-gyp

Yarn add sqlite3

npm install sqlite3

What is the expected behavior?

Libraries are successfully installed,there is not errors

System information

sylirre commented 1 month ago

Please don't run coding stuff on /storage/emulated/0. This directory has a file system that does not support special files (symlinks) and attributes (e.g. executable bit).

Do everything in Termux home. Many Android code editor apps support volumes and can access Termux home without needing root permissions.

Not a Termux bug.