Is there a way to utilize "npm install ts-node-dev -D" in Termux?

npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../acorn/bin/acorn
npm ERR! dest /storage/emulated/0/bot-baiano/node_modules/.bin/acorn
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, unable to create symlink from '../acorn/bin/acorn' to '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'
npm ERR!  [Error: EACCES: permission denied, unable to create symlink from '../acorn/bin/acorn' to '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../acorn/bin/acorn',
npm ERR!   dest: '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the necessary permissions to access this file as the current user
npm ERR!
npm ERR! If you suspect a permissions issue, please verify the
npm ERR! permissions of the file and its parent directories, or try running
npm ERR! the command again with root/Administrator privileges.

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2022-05-27T14_44_58_844Z-debug-0.log

Answer №1

In order to continue the installation process within /storage/emulated, simply append the --no-bin-links command at the conclusion of your npm command. For example:

npm install ts-node-dev -D --no-bin-links

I have successfully used this code myself.

Answer №2

The issue arises from attempting to install packages in the phone storage directory (/storage/emulated) where your phone does not have full access. This means you may encounter limitations, such as being unable to create symlinks in that location. You can find more information about this constraint in the Termux documentation.

As a solution, it is advised to operate within your Termux partition ($HOME/$PREFIX). I have personally executed the same command there and obtained the following outcome:

~/git-repo/test $ npm i ts-node-dev -D

added 65 packages, and audited 66 packages in 2s

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

found 0 vulnerabilities

While there are potential workarounds to enable functionality in the ~/storage partition, it may result in other accessibility issues. If you require access to files outside of Termux (e.g., through an IDE app), I have elaborated on this topic in response to a similar inquiry here.

I hope this information proves helpful.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

TypeScript class that utilizes internal functions to implement another class

In my journey of exploration, I decided to try implementing a class within another class in TypeScript. Here is the code snippet I came up with and tested on the Playground link: class A { private f() { console.log("f"); } public g() { console.lo ...

Tips for accessing the 'index' variable in *ngFor directive and making modifications (restriction on deleting only one item at a time from a list)

Here is the code snippet I'm working with: HTML: <ion-item-sliding *ngFor="let object of objectList; let idx = index"> <ion-item> <ion-input type="text" text-left [(ngModel)]="objectList[idx].name" placeholder="Nam ...

Tips for utilizing innerHTML in TypeScript code within an Angular 2 application

Is there a way to utilize innerHTML from TypeScript code in Angular 2 RC4? I'm facing an issue: I need to dynamically add precompiled HTML code when a specific button is clicked. For instance: TypeScript code private addHTML() { // not sure how ...

Combining URL parameters into an object with NestJS's HTTP module

Is there a method for passing URL parameters to the httpService in nestjs? I want to improve the readability of this URL without resorting to Axios as nest has its own HTTPModule. Currently, this is how it looks and functions: const response = await this. ...

Cloudinary package encountered an error - Syntax Error detected

After several attempts, I am still struggling to resolve an error related to the NPM package from cloudinary. Despite my efforts, I have been unable to find any relevant information through online searches. { fieldname: 'name-of-input-key', or ...

Achieving CommonJS imports compilation with Typescript

In my TS file, I've included a 3rd party package using import XXX { YYY, ABC, 123 } from 'XXX'; While it compiles to CommonJS without any issues, I'd prefer to have it compiled to an ESModule instead. I tried changing the target and mo ...

Sharing information between different components in React can be done using props, context, or a

When attempting to edit by clicking, the parent information is taken instead of creating a new VI. I was able to achieve this with angular dialog but I am unsure how to do it with components. This is done using dialog: <div class="dropdown-menu-item" ...

React Redux: Discrepancy in Variable Value Between Internal and External Function within Custom Hook

Encountering a challenge with a custom React hook utilizing Redux, where a variable's value inside and outside a function within the same hook is inconsistent. Simplified code snippet provided below: import { useAppSelector } from "Redux/helpers& ...

Guide to Angular 6 Reactive Forms: Automatically filling one text field when another input is selected

I'm currently learning Angular 6 and exploring reactive forms. I want to set up a feature where selecting an option in one field will automatically populate another field. The objective is to have the coefficient input update based on the number sele ...

Angular2: PrimeNG - Error Retrieving Data (404 Not Found)

I'm facing an issue with using Dialog from the PrimeNG Module. The error message I keep getting is: Unhandled Promise rejection: (SystemJS) Error: XHR error (404 Not Found) loading http://localhost:4200/node_modules/primeng/primeng.js I followed the ...

Breaking down nested arrays in typescript

After receiving a response from the service, the data included the following: "rows": [ [ "stravi/aa", "202001", "59", "51", "2558.98", "0.5358894453719162", "1.9204668112983725", "140", "2.346630 ...

When I run 'npm install', I am looking to automatically download additional resources by utilizing a 'prepublish' script

Is it possible to download angular.min.js during the 'npm install' process? I came across this information which suggests using a prepublish script for such tasks. It also states that there's no need to have wget/curl installed on the syste ...

When attempting to use a value outside of its block, the function may return a

My current task involves querying one collection to retrieve IDs, then using those IDs to query another collection and send back the response. The process runs smoothly until I encounter an issue with retrieving values outside of a block when using forEach ...

The issue of TypeScript failing to return HTML Template Element from Constructor typing is causing complications

There is a restriction on using new to create an instance of Template, which extends an HTMLTemplateElement. To work around this limitation, I fetch and return an HTMLTemplateElement by using document.getElementById(id) within the constructor of the Templ ...

Problem with file permissions in Linux (Node Package Manager's node_modules folder)

I am facing difficulties in managing permissions for my node_modules directory. The issue is as follows... When user1 installs packages using npm install, the resulting node_modules directory is owned by user1. Subsequently, when user2 attempts to instal ...

The Allure Report runs successfully but encounters issues with data population when using Jasmine and Protractor

Currently, I am facing an issue with my Protractor project set up that incorporates Allure Reporting. Although the Allure Reporter successfully outputs the HTML file to the allure-report directory, when I attempt to view it in a browser, all I see is a "Lo ...

Typescript provides the flexibility to construct incomplete or partially valid objects

My attempt to create a partial helper function in Typescript led me to an incorrect version that went unnoticed by Typescript: Typescript version: 5.2.2 type A = { a: number; b: string }; // incorrect const buildPartialBad = (key: keyof A, val: A[keyof A ...

What is the best way to simulate a constructor-created class instance in jest?

Suppose there is a class called Person which creates an instance of another class named Logger. How can we ensure that the method of Logger is being called when an instance of Person is created, as shown in the example below? // Logger.ts export default cl ...

Listening for value changes on a reactive form seems to be a challenge for me

While attempting to listen for value changes on a reactive form, I ran into the following error: This expression is not callable. Type 'Observable<string | null>' has no call signatures. searchWord = this.fb.group({ word: ['' ...

Installation of the Cypress module was unsuccessful

I attempted to add the cypress module to my project npm install cypress --save-dev cypress.io is hosted on Cloudflare and it's causing issues with the installation: URL: https://download.cypress.io/desktop/3.4.1?platform=linux&arch=x64 ...