2

I'm unable to install Express in Android Termux. I have the latest Node.js installed.

It is working perfectly when I use Private storage, but I'm using cd /storage/sdcard0/NodeJS/Test/ and getting a permission denied error. I saw the word symlink repeatedly in the terminal's error message.

Here's what I saw after commanding npm install express --save:

$ npm install express --save
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! path ../mime/cli.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../mime/cli.js' -> '/storage/sdcard0/NodeJS/Test/3/node_modules/.bin/mime'
npm ERR!  { Error: EACCES: permission denied, symlink '../mime/cli.js' -> '/storage/sdcard0/NodeJS/Test/3/node_modules/.bin/mime'
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, symlink '../mime/cli.js' -> '/storage/sdcard0/NodeJS/Test/3/node_modules/.bin/mime'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'symlink',
npm ERR!      path: '../mime/cli.js',
npm ERR!      dest: '/storage/sdcard0/NodeJS/Test/3/node_modules/.bin/mime' },
npm ERR!   stack: 'Error: EACCES: permission denied, symlink \'../mime/cli.js\' -> \'/storage/sdcard0/NodeJS/Test/3/node_modules/.bin/mime\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../mime/cli.js',
npm ERR!   dest: '/storage/sdcard0/NodeJS/Test/3/node_modules/.bin/mime',
npm ERR!   parent: 'test-lab' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2018-05-29T13_09_20_748Z-debug.log

Is it really possible to install Express while current storage is something like /storage/sdcard0/...?

1

2 Answers 2

2

Unfortunately, the answer is No, not even with root.

Android uses FUSE (Filesystem in USErspace), which has symbolic links disabled. Since Node needs to setup symlinks, it's impossible to install it onto the SD card (or whatever internal storage where you store your photos, downloads, etc.). You can only install it into Termux's directory, which is /data/data/com.termux/files.

7
  • I've already installed nodejs successfully. The problem is that I'm unable to install a nodejs module or package or plugin or whatever it is called. I was thinking of saving the app.js, package.json and the express files into a directory in sdcard0 or sdcard1. May 29, 2018 at 16:46
  • Are you saying I can't save files (of Express) to sdcard ? May 29, 2018 at 16:47
  • @user9850863 You can't install that Node module onto the SD card. But yeah, Node.js itself is already set up in Termux's directories.
    – iBug
    May 30, 2018 at 1:06
  • Yes you are correct. May 30, 2018 at 2:33
  • @user9850863 I'm honored. But if you only want to access Termux's files, you can copy them in/out to SD card with Termux. Then you can use an arbitrary file manager, without affecting the local copy that Termux holds.
    – iBug
    May 30, 2018 at 2:40
0

I fix it with this:

  1. Install Termux:API (Play Store).
  2. In Termux shell: apt install termux-api

That's all. https://www.npmjs.com/package/termux

1
  • How? Just installing it ? Jun 30, 2018 at 1:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .