weseek/growi-docker-compose

Growi3.1.3のbuild:prod時にエラーになる

ibuki opened this issue · 2 comments

ibuki commented

Growiのメンテナンスお疲れ様です。いつもお世話になっております。

docker-composeで普段利用しているのですが、環境を再構築する際にエラーが出ました。

Dockerfileを FROM weseek/growi:3.0にすると動作するので修正まではそれで利用を続けたいと思います。

エラーの詳細は以下になります。

growi-docker-compose$ docker build . --no-cache
Sending build context to Docker daemon  140.3kB
Step 1/6 : FROM weseek/growi:3

中略

Step 6/6 : RUN npm run build:prod
 ---> Running in 4563e00bd1af

> growi@3.1.3 prebuild:prod /opt/growi
> npm run plugin:def


> growi@3.1.3 plugin:def /opt/growi
> node bin/generate-plugin-definitions-source.js

module.js:549
    throw err;
    ^

Error: Cannot find module 'normalize-path'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/growi/bin/generate-plugin-definitions-source.js:7:19)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! growi@3.1.3 plugin:def: `node bin/generate-plugin-definitions-source.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the growi@3.1.3 plugin:def script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-06-08T04_52_16_012Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! growi@3.1.3 prebuild:prod: `npm run plugin:def`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the growi@3.1.3 prebuild:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-06-08T04_52_16_026Z-debug.log
The command '/bin/sh -c npm run build:prod' returned a non-zero code: 1

お時間のある時で構いませんのでご対応いただけると助かります。

症状としては、yarn が失敗しているときとか、NODE_ENV に production が指定されている状態で yarn してからビルドが走っている状態に似ていますね。

  • yarn が失敗していないか
  • docker のコンテナ内で NODE_ENF が production 指定されていないか(ホストの設定が影響していないか)

を確認してみてください。

ibuki commented

3.1.3固有の問題だったようです。最新の3.1.6や3.1.4で問題なく動作しました。
ご対応ありがとうございます。