1
我在使用webpacker和vue向數字海洋液滴部署簡單的rails應用程序時遇到問題。rails 5.1.4 vue和webpacker,部署時編譯失敗錯誤
只要我將時刻依賴關係添加到vue組件,服務器上的編譯過程就會失敗。 (沒有輸出)我對如何找到解決方案感到迷茫。
我添加在main.js依賴性方式:
import moment from 'moment';
Vue.prototype.$moment = moment
以及如何使用它的部件:
this.score.day = this.$moment().format('YYYY-MM-DD');
輸出服務器關於「RAILS_ENV =生產箱/束上exec rake資產:預編譯 - 跟蹤'
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke yarn:install (first_time)
** Execute yarn:install
yarn install v1.1.0
[1/4] Resolving packages...
success Already up-to-date.
Done in 1.85s.
** Execute assets:precompile
** Invoke webpacker:compile (first_time)
** Invoke webpacker:verify_install (first_time)
** Invoke webpacker:check_node (first_time)
** Execute webpacker:check_node
** Invoke webpacker:check_yarn (first_time)
** Execute webpacker:check_yarn
** Invoke webpacker:check_binstubs (first_time)
** Execute webpacker:check_binstubs
** Execute webpacker:verify_install
Webpacker is installed
Using /var/www/beleep-2/config/webpacker.yml file for setting up webpack paths
** Invoke environment
** Execute webpacker:compile
Compiling…
Compilation failed:
在組件結果i中添加依賴項的其他方法同樣的問題。一切工作在我的筆記本電腦開發模式完美。希望你們中的任何人都能指出我正確的方向來解決這個問題?!
謝謝。你剛剛回答了一個問題,我試圖找出幾個小時。 – mackmack