Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install npm packages #3193

Closed
praisedare opened this issue Jan 18, 2023 · 2 comments
Closed

Unable to install npm packages #3193

praisedare opened this issue Jan 18, 2023 · 2 comments

Comments

@praisedare
Copy link

praisedare commented Jan 18, 2023

Problem description

I got the latest version of termux from f-droid, and now I can't install npm packages. This is the error I get:

FetchError: invalid json response body at https://registry.npmjs.org/cookie-parser
reason: Invalid response body while trying to fetch https://registry.npmjs.org/cookie-parser: 
EACCES: permission denied, link '/data/data/com.termux/files/home/.npm/_cacache/tmp/0b56d70b' -> '/data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/46/59/c4dbad934776e85ea9d0ec5bbe71a8e80eeff6b2dc8bff5267224a2dae2b6b7767bc0fc988e05553e8885b697c3d2310741c5b7ff1c67ea8fcf6f376ccd2'

I tried adding read and write permissions for everyone with chmod but I'm still getting the same error. And no I'm not rooted, so I can't run npm as superuser.

Steps to reproduce the behavior.

# cd into any node app and run
npm install

### What is the expected behavior?

Should successfully install npm packages

### System information

* Termux application version: 118
* Android OS version: 10
* Device model: Tecno KC8
@luisdavim
Copy link

I think you should report this in there termux packages repo not here. Meanwhile, try uninstalling npm, remove that folder from your home directory and then install again.

@sylirre
Copy link
Member

sylirre commented Jan 18, 2023

Duplicate of termux/termux-packages#13293.

npm tries to make a hardlink which on Android requires SELinux to be put in permissive mode or root user shell.

One of possible workarounds could be use of PRoot, example:

proot --link2symlink npm install <your package>

@sylirre sylirre closed this as completed Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants