1

I'm unable to install express in Android termux. I have latest nodejs installed. It is working perfectly when I use Private storage but I'm using cd /storage/sdcard0/NodeJS/Test/ and getting 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 test-lab@1.0.0 No description
npm WARN test-lab@1.0.0 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/....... ?

0

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.

  • 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. – user9850863 May 29 '18 at 16:46
  • Are you saying I can't save files (of Express) to sdcard ? – user9850863 May 29 '18 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 '18 at 1:06
  • Yes you are correct. – user9850863 May 30 '18 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 '18 at 2:40
0

I fix it with this:

Install termux api in play store. In termux shell: apt install termux-api Thats all. https://www.npmjs.com/package/termux

  • How? Just installing it ? – user9850863 Jun 30 '18 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.