weseek/growi-docker-compose

Growiへのマイグレーションで Error: Cannot find module 'normalize-path' というエラーが発生。

Closed this issue · 3 comments

お世話になります。
https://github.com/weseek/growi-docker-compose/wiki/Migrate-from-crowi-plus-docker-compose
に従い、マイグレーションを試みたところ、下記エラーが発生し困っております。

以下が類似の問題のようですが、私の環境(ホストがubuntu16.04)ではGrowiの3.2.x系と3.1.x系は試したものすべて全滅でした(3.0.x系はまだ試していません)。
#13

Dockerということであまり考えづらいとは思うのですが、環境依存の何かがあるのでしょうか?

ubuntu:~/crowi-plus$ docker-compose up -d
Creating network "crowiplus_default" with the default driver
Building app
Step 1/6 : FROM weseek/growi:3
3: Pulling from weseek/growi
4fe2ade4980c: Already exists
eeb7d76f44e7: Already exists
e35f88fcc259: Already exists
a6e42d06e5b7: Already exists
76e3a313d935: Already exists
48ffa976c41c: Already exists
a084f2bca408: Already exists
192825940cf6: Already exists
Digest: sha256:6bd17f5c212749eefeca7ce2aefa781c5497367df04ee516c88477d447eba196
Status: Downloaded newer image for weseek/growi:3
 ---> d46bc5510b11
Step 2/6 : ENV APP_DIR /opt/growi
 ---> Running in 8c2b3f8db79f
 ---> 29fe6586a203
Removing intermediate container 8c2b3f8db79f
Step 3/6 : ENV DOCKERIZE_VERSION v0.3.0
 ---> Running in a176d31aff4c
 ---> 01564a15ee2e
Removing intermediate container a176d31aff4c
Step 4/6 : RUN apk add --no-cache --virtual .dl-deps curl     && curl -SL https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz         | tar -xz -C /usr/local/bin     && apk del .dl-deps
 ---> Running in d6e7ce88a17c
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/6) Installing ca-certificates (20171114-r3)
(2/6) Installing nghttp2-libs (1.32.0-r0)
(3/6) Installing libssh2 (1.8.0-r3)
(4/6) Installing libcurl (7.61.1-r1)
(5/6) Installing curl (7.61.1-r1)
(6/6) Installing .dl-deps (0)
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 8 MiB in 22 packages
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   625    0   625    0     0   1237      0 --:--:-- --:--:-- --:--:--  1237
100 2436k  100 2436k    0     0  1005k      0  0:00:02  0:00:02 --:--:-- 1280k
(1/6) Purging .dl-deps (0)
(2/6) Purging curl (7.61.1-r1)
(3/6) Purging libcurl (7.61.1-r1)
(4/6) Purging ca-certificates (20171114-r3)
WARNING: Ignoring APKINDEX.adfa7ceb.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.efaa1f73.tar.gz: No such file or directory
Executing ca-certificates-20171114-r3.post-deinstall
(5/6) Purging nghttp2-libs (1.32.0-r0)
(6/6) Purging libssh2 (1.8.0-r3)
Executing busybox-1.28.4-r1.trigger
OK: 6 MiB in 16 packages
 ---> 625bf66d18b8
Removing intermediate container d6e7ce88a17c
Step 5/6 : WORKDIR ${APP_DIR}
 ---> 9943df33e176
Removing intermediate container 9eed49c3b752
Step 6/6 : RUN npm run build:prod
 ---> Running in deb2cc7bb2c6

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


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

module.js:550
    throw err;
    ^

Error: Cannot find module 'normalize-path'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._resolveFilename (/opt/growi/node_modules/module-alias/index.js:43:29)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/growi/bin/generate-plugin-definitions-source.js:9:19)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! growi@3.2.8 plugin:def: `node bin/generate-plugin-definitions-source.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the growi@3.2.8 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-11-21T07_33_49_525Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! growi@3.2.8 prebuild:prod: `npm run plugin:def`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the growi@3.2.8 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-11-21T07_33_49_543Z-debug.log
ERROR: Service 'app' failed to build: The command '/bin/sh -c npm run build:prod' returned a non-zero code: 1

ちなみにDockerのバージョンは以下の通りです。

ubuntu:~$ docker -v
Docker version 17.09.0-ce, build afdb6d4
ubuntu:~$ docker-compose -v
docker-compose version 1.11.1, build 7c5d5e4

@emadurandal
https://github.com/weseek/growi-docker-compose/wiki/Migrate-from-crowi-plus-docker-compose

に則って docker-compose.yml を編集すると、 Dockerfile からは npm run build:prod の行はコメントアウトされると思います。
張っていただいたログには

Step 6/6 : RUN npm run build:prod

という記述がありますので、最終行だけ残っているのではないでしょうか。
ご確認ください。

@yuki-takei ありがとうございます。おっしゃるとおりでした。最終行はいらないのですね。無事動きました。ありがとうございます。本件、クローズさせていただきます。