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