电子打包器在以root身份运行时无法构建

时间:2016-08-27 23:48:15

标签: electron

问题

我运行这些命令:

git clone electron-quick-start
cd electron-quick-start
npm install
npm install electron-packager --save-dev
npm run-script pack

运行:

electron-packager . MyApp --platform=linux --arch=x64 --prune

在流浪汉中,作为用户流浪者,它起作用。

当我在vagrant中以root身份运行它时,它会因ENAMETOOLONG错误而失败。

当我在Docker容器中以root身份运行时,它也会以同样的方式失败。 问题是我的CI,buildbot,以root身份运行。

流浪路径:PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/node-v6.4.0-linux-x64/bin

根路径:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/node-v6.4.0-linux-x64/bin

我尝试过使用--out=dist --ignore=dist,但这不起作用。

read如果您指定要打包的内容,可能会解决此问题,但我不知道该怎么做。

成功以用户流浪者身份运行

$npm run-script pack
> electron-quick-start@1.0.0 pack /home/vagrant/electron-quick-start
> electron-packager . MyApp --platform=linux --arch=x64 --prune
Packaging app for platform linux x64 using electron v1.3.4
Wrote new app to /home/vagrant/electron-quick-start/MyApp-linux-x64
$

以root用户身份运行错误

$npm run-script pack
> electron-quick-start@1.0.0 pack /root/electron-quick-start
> electron-packager . MyApp --platform=linux --arch=x64 --prune
Packaging app for platform linux x64 using electron v1.3.4
[ { Error: ENAMETOOLONG: name too long, unlink "/root/electron-quick-
start/electron-packager/linux-x64/MyApp-linux-x64/resources/app/
electron-packager/linux-x64/MyApp-linux-x64/resources...
(Alot of repetition)...
MyApp-linux-x64/blink_image_resources_200_percent.pak"

at Error (native)
errno: -36,
code: "ENAMETOOLONG",
syscall: "unlink",

Several screens full of similar error, but different file names at end, finally:

npm ERR! Linux 3.10.0-327.18.2.el7.x86_64
npm ERR! argv "/opt/node-v6.4.0-linux-x64/bin/node" "/bin/npm" "run-script" "pack"
npm ERR! node v6.4.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! electron-quick-start@1.0.0 pack: "electron-packager . MyApp --platform=linux --arch=x64 --prune"
npm ERR! Exit status 1
$

环境信息

Mac OS X 10.11.5
Vagrant version: 1.8.4
Linux CentOS 7 3.10.0-327.18.2.el7.x86_64
node version: v6.4.0
npm version: v3.10.6
electron version: 1.3.4
electron-packager version: 7.7.0
Python version: 2.7.5
Buildbot version: 0.8.14
Buildslave version: 0.8.14
Twisted version: 16.3.2

0 个答案:

没有答案