0

我努力在軌道/ Webpacker項目上設置Wercker。Wercker配置軌道5.1 + reactjs與webpacker gem

我首先必須添加步驟來安裝節點,然後另一個預編譯反應包,然後安裝紗線。首先,它是好的,但後來我加入依賴於該項目,並知道我卡在3依賴性具有相同的錯誤消息:

ERROR in ./app/javascript/app/index.js 
Module not found: Error: Can't resolve 'redux-thunk' in '/pipeline/source/app/javascript/app' 
@ ./app/javascript/app/index.js 5:0-32 
@ ./app/javascript/packs/app.js 

這與redux-thunkreact-redux-i18nreact-spinkit

我只有發生試圖添加一個步驟yarn install,它通過該過程但不能解決問題。

這是我的wercker.yml

# wercker.yml 
box: ruby:2.4.1 

services: 
    - redis 
    - postgres 

build: 
    steps: 
     - louischavane/[email protected] 
     - rails-database-yml 
     - script: 
      name: nokogiri tricks 
      code: bundle config build.nokogiri --use-system-libraries 
     - bundle-install 
     - bigtruedata/[email protected] 
     - akupila/[email protected] 
     - script: 
      name: yarn-install 
      code: yarn install 
     - script: 
      name: pre-compile react packs 
      code: NODE_ENV=test bundle exec rails webpacker:compile 
     - script: 
      name: run migration 
      code: rake db:migrate RAILS_ENV=test 
     - script: 
      name: load fixture 
      code: rake db:fixtures:load RAILS_ENV=test 
     - script: 
      name: run rubocop 
      code: bundle exec rubocop 
     - script: 
      name: test 
      code: bundle exec rake test RAILS_ENV=test 

回答

0

實測值的方式圍繞添加步驟預編譯之前去除節點模塊:

- script: 
    name: delete node modules 
    code: rm -rf node_modules