简体   繁体   English

在 linux 上运行节点(ffmpeg)产生错误:spawn EACCES

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

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.所以我在 android (Arm v7a) 上使用 nodejs 前端应用程序来运行 ffmpeg,尤其是 fluent-ffmpeg,这里的问题是,当我运行命令时,控制台只会说“错误生成 /ffmpeg eacces”,是的,我移动了ffmpeg到根分区,我尝试了对ffmpeg文件夹和文件的各种权限,从777开始,因为我的手机已经root了。 And well, I don't know how to run the app with superuser rights.好吧,我不知道如何以超级用户权限运行该应用程序。

How can I solve the eacess error?如何解决 eacess 错误?

It's not recommended to use sudo with npm install, follow the steps from npmjs official docs instead :)不建议将 sudo 与 npm install 一起使用,请按照 npmjs 官方文档中的步骤操作 :)

Make a directory for global installations:为全局安装创建一个目录:

mkdir ~/.npm-global mkdir ~/.npm-global

Configure npm to use the new directory path:配置 npm 以使用新的目录路径:

npm config set prefix '~/.npm-global' npm 配置设置前缀 '~/.npm-global'

Open or create a ~/.profile file and add this line:打开或创建一个 ~/.profile 文件并添加以下行:

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

Back on the command line, update your system variables:返回命令行,更新系统变量:

source ~/.profile源〜/ .profile

Test: Download a package globally without using sudo.测试:在不使用 sudo 的情况下全局下载一个包。

npm install -g typescript npm install -g 打字稿

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM