Running node (ffmpeg) on linux produces Error: spawn EACCES

422 Views Asked by At

So I'm using a nodejs frontend app on android (Arm v7a) to run ffmpeg, especially fluent-ffmpeg, the problem here is that when I run a command the console just says "error spawn /ffmpeg eacces", yes, I moved ffmpeg to the root partition and I tried all kind of permissions to the folder and the file of ffmpeg, starting from 777 because my phone is rooted. And well, I don't know how to run the app with superuser rights.

How can I solve the eacess error?

1

There are 1 best solutions below

0
On

It's not recommended to use sudo with npm install, follow the steps from npmjs official docs instead :)

Make a directory for global installations:

mkdir ~/.npm-global

Configure npm to use the new directory path:

npm config set prefix '~/.npm-global'

Open or create a ~/.profile file and add this line:

export PATH=~/.npm-global/bin:$PATH

Back on the command line, update your system variables:

source ~/.profile

Test: Download a package globally without using sudo.

npm install -g typescript

Source: https://docs.npmjs.com/getting-started/fixing-npm-permissions