DockerでNuxt×Railsの環境構築をしていました。
認証にFirebaseのAuthを使用したいと思い、npm install --save firebase を行いました。
すると下記のようなエラーがでてインストールできませんでした。
node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for grpc@1.24.2 and node@12.5.0 (node-v72 ABI, musl) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error unable to verify the first certificate gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16) gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5 gyp ERR! stack at FSReqCallback.oncomplete (fs.js:165:21) gyp ERR! System Linux 4.9.184-linuxkit gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72" gyp ERR! cwd /app/node_modules/grpc gyp ERR! node -v v12.5.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/app/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:200:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) node-pre-gyp ERR! System Linux 4.9.184-linuxkit node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library" node-pre-gyp ERR! cwd /app/node_modules/grpc node-pre-gyp ERR! node -v v12.5.0 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/app/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-musl --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/watchpack/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! grpc@1.24.2 install: `node-pre-gyp install --fallback-to-build --library=static_library` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the grpc@1.24.2 install 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! /app/.npm/_logs/2020-02-03T06_13_35_101Z-debug.log
Nuxt側のDockerfileです
Dockerfile FROM node:12.5.0-alpine ENV HOME="/app" \ LANG=C.UTF-8 \ TZ=Asia/Tokyo WORKDIR ${HOME} RUN apk update && \ apk upgrade && \ npm config set registry http://registry.npmjs.org/ \ npm install -g npm && \ npm install -g @vue/cli\ yarn global add create-nuxt-app ENV HOST 0.0.0.0 EXPOSE 3000
ちなみに、firebaseの記事で調べているとfirebase-toolsというものも出てきたので、インストールしてみるとそちらはインストールできました。
ご教授いただければ幸いです。