[英]Phoenix Edeliver release failure at npm install
我正在嘗試將Elixir,Phoenix應用程序發布到帶有釀酒廠和edeliver的數字海洋服務器。 每當執行以下命令時,都會出現錯誤。
mix edeliver build release --verbose
錯誤信息
A remote command failed on:
username@server-ip
Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:
FAILED with exit status 255:
[ -f ~/.profile ] && source ~/.profile
set -e
cd '/home/username/myapp/builds/assets'
npm install
mix.exs
{:distillery, "~> 1.4"},
{:edeliver, "~> 1.4.3"}
.deliver / config
APP="myapp"
BUILD_HOST="server-ip"
BUILD_USER="username"
BUILD_AT="/home/username/myapp/builds"
PRODUCTION_HOSTS="server-ip"
PRODUCTION_USER="username"
DELIVER_TO="/home/username"
pre_erlang_clean_compile() {
status "Installing NPM dependencies"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT/assets'
npm install $SILENCE
"
status "Building static files"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT'
mkdir -p priv/static
npm run deploy $SILENCE
"
status "Running phoenix.digest"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT'
APP='$APP' MIX_ENV='$TARGET_MIX_ENV' $MIX_CMD phoenix.digest $SILENCE
"
}
每當我登錄服務器並安裝npm時,它都可以工作。
package.json
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "brunch build --production",
"watch": "brunch watch --stdin"
},
"dependencies": {
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html"
},
"devDependencies": {
"babel-brunch": "6.1.1",
"brunch": "2.10.9",
"clean-css-brunch": "2.10.0",
"uglify-js-brunch": "2.10.0"
}
}
服務器:Ubuntu 16.04.4 Nodejs v6.14.3 Elixir 1.6.5(與OTP 19編譯)
本地:macOS High Sierra
我進行了很多搜索,然后嘗試重新安裝npm和nodejs。 在.deliver / config中更改cd'$ BUILD_AT / assets'無效。 我也嘗試在prod.exs中添加它
server: true,
code_reloader: false,
version: Mix.Project.config[:version]
仍然有問題。
首先通過SSH連接到服務器,然后在路徑/home/username/myapp/builds/assets
嘗試運行npm install
,這將向您顯示服務器上的錯誤日志。
這不是解決方案,但可以讓您了解服務器中正在發生的事情
當我大量搜索以解決問題時,我發現了一種更好的方法來部署我的應用程序。 我找到了一個名為Nanobox的服務
我決定嘗試一下,並且能夠在幾個小時內部署該應用程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.