【发布时间】:2018-01-23 02:38:47
【问题描述】:
我的应用需要包:man,但默认情况下它没有安装在 heroku/nodejs buildpack 上。
所以根据the documentation,heroku/heroku-buildpack-apt 是当您的应用需要额外的 apt 依赖项时的工作工具。
我分配了新的 buildpack 并在项目的根目录中添加了 Aptfile 一行:
man
这是我的完整 package.json
{
"name": "unix-translator",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"test": "mocha --exit"
},
"dependencies": {
"body-parser": "~1.18.2",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.15.5",
"jade": "~1.11.0",
"morgan": "~1.9.0",
"node-dev": "^3.1.3",
"serve-favicon": "~2.4.5",
"dateTools": "file:lib/unix-command"
},
"devDependencies": {
"chai": "^4.1.2",
"mocha": "^4.1.0"
}
}
这是我的 Procfile:
web: node ./bin/www
这会成功安装依赖项,因为我现在运行which man 时看到它。但它不起作用。
当我尝试使用man 程序时出现此错误:
~ $ man cat
man: error while loading shared libraries: libmandb-2.7.5.so: cannot open shared object file: No such file or directory
我确实找到了this blog post 和this other blog post,它们都表明与权限和文件位置有关的问题...我通过 SSH 连接到我的测功机并运行:/sbin/ldconfig -v,它最终抛出了这个错误:
/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Read-only file system
^ 该命令需要使用sudo 运行,而这在测功机中不可用。 :-(
所以我又卡住了。
【问题讨论】:
-
你能分享你的 Procfile 和 package.json 吗?
-
@YoniRabinovitch 完成。我更新了上面的问题。
标签: node.js heroku apt-get manpage