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

Tips for implementing absolute import paths in a library project

In my workspace, I have a library with two projects: one for the library itself and another for a test application. ├── projects    ├── midi-app    └── midi-lib Within the workspace's tsconfig.json file, I set up paths for @a ...

Error message in Ionic: unable to spawn "C:Program Files odejs ode.exe" due to ENOENT error

An error occurred at notfounderror (C:\Users\myusrname\appdata\roaming\npm\nodr_modeules\ionic\cross-spawn\lib\enoent.js:11:11) while verifying ENOENT(C:\Users\myusrname\appdata\roaming& ...

Accessing an external API through a tRPC endpoint (tRPC Promise is resolved before processing is complete)

I want to utilize OpenAI's API within my Next.js + tRPC application. It appears that my front-end is proceeding without waiting for the back-end to finish the API request, resulting in an error due to the response still being undefined. Below is my e ...

How can I configure Material-UI's textfield to return a numerical value instead of a string when the type is set to "number"?

Utilizing Material-UI's TextField alongside react-hook-form to monitor inputs has raised an issue for me. I have observed that regardless of the input type, it always returns a string. This creates conflicts with the data types I am using in my codeba ...

Dexie is alerting us to a problem with a call that occurs before initialization

When setting up my application, I encountered an error related to the Courses Entity Class being called before initialization in my Dexie Database. Despite checking my code, I couldn't find any issues and there was no documentation available for this ...

Using TypeScript, apply an event to every element within an array of elements through iteration

I have written the code snippet below, however I am encountering an issue where every element alerts the index of the last iteration. For instance, if there are 24 items in the elements array, each element will alert "Changed row 23" on change. I underst ...

The property '.....' is missing an initializer and has not been explicitly assigned in the constructor

I want to address an issue with a similar question title that was asked 5 years ago on Stack Overflow. The problem is related to declaring a variable as an array of a specific object type in an Angular component using TypeScript 4.9. Even though I tried t ...

Simulation service agent partnered with openApi backend

I am currently utilizing MSW along with the OpenAPI-backend package for my project. I aim to mock both the browser server and test server using OpenAPI specifications. With an available OpenAPI definition, I generate `generated.ts` for RTK Query (which is ...

Generate a new data type based on the value of a single attribute within a collection of objects

Is there a way to extract a specific property of a combined type and generate a new type from it? Consider the following example: type Actions = | { type: "ADD_COLUMN"; newColumnIndex: number; column: SelectorColumnData; } | { type: ...

Leveraging a package.json variable within an npm script

While utilizing npm run to compile a JavaScript file with browserify, I have encountered an issue. Prior to the compilation process, I intend for it to generate a folder within my build directory that corresponds to the version specified in the package.jso ...

Updating an element within a for loop using Angular TypeScript

I'm trying to figure out how to update the value of an HTML DOM element that is bound from a TypeScript file in each iteration of a for loop, rather than at the end of the loop. I want to see all values as the loop is running. For example, imagine I ...

Create a global variable by importing an external module in TypeScript

I am currently developing a TypeScript npm module called https://www.npmjs.com/package/html2commonmark. This module is versatile and can be utilized in nodejs (via require) as well as in the browser (by loading node_modules/html2commonmark/dist/client/bund ...

Having trouble utilizing Vue CLI 3

When I tried to create a new Vue app using vue CLI 3 with the command vue create my-app, I encountered an error message saying zsh: command not found: vue. However, during the installation of vue CLI, I noticed the following warning: npm WARN deprecated ...

Receiving Yarn's 401 Unauthorized error while attempting to install a package from a private repository

Utilizing the private repository features of gitea, I followed the settings outlined in the official documentation: npm config set {scope}:registry https://gitea.example.com/api/packages/{owner}/npm/ npm config set -- '//gitea.example.com/api/packages ...

Using useState, react, and typescript, is there a way to set only the icon that has been clicked to

When I click on the FavoriteIcon inside the ExamplesCard, all the icons turn red instead of just the one that was clicked. My approach involves using useState to toggle the icon state value between true and false, as well as manipulating the style to adjus ...

Having trouble installing npm? Try running npm install lite-server -g to fix the issue

As soon as I press enter, this message appears. Modified 170 packages, and examined 171 packages in just 12 seconds There are 6 packages seeking funding. To learn more, execute npm fund No vulnerabilities were found ...

The return type in Typescript is populated with a generic type name that lacks meaningful

When utilizing ts-results-es, I encounter an issue. This library aids in wrapping errors within a class to provide insight into potential function errors. Here is a simplified class definition: interface BaseResult<T, E> {} class Err<E> imple ...

A more concise validation function for mandatory fields

When working on an HTML application with TypeScript, I encountered a situation where I needed to build an error message for a form that had several required fields. In my TypeScript file, I created a function called hasErrors() which checks each field and ...

The new update for npm publish includes a change that involves renaming the .gitignore file to

I've developed a custom Yeoman generator to set up a standard Git repository directory structure. One of the elements included is a .gitignore file located in the \generators\app\templates\ directory. Upon uploading this generator ...

How can Karma unit tests with Jasmine in a TypeScript Node project accurately measure code coverage, even with external dependencies?

We have a unique situation with the code coverage of our project involving a node dependency. It's important to note that the npm dependency source code is actually part of our project, as we are responsible for its development and publication. Here&a ...