Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python path issue in most recent node:alpine? #715

Closed
jlafortune opened this issue May 1, 2018 · 2 comments
Closed

Python path issue in most recent node:alpine? #715

jlafortune opened this issue May 1, 2018 · 2 comments

Comments

@jlafortune
Copy link

Trying to compile a dependency that requires Python with node:alpine. Receiving a message that Python isn't on the path. The Docker build works correctly if I change to node:9-alpine. So I believe something changed with respect to Python between these two releases. Any thoughts? The full error and how to reproduce is below. Thanks!

package.json

  "name": "python_err",
  "version": "1.0.0",
  "description": "Demo the Python issue",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@google-cloud/pubsub": "^0.18.0"
  }
}

Dockerfile

FROM node:alpine
COPY package.json .
RUN npm install
COPY index.js .
CMD ['node', 'index.js']

index.js

console.log('hello');

Error

Sending build context to Docker daemon  79.47MB
Step 1/5 : FROM node:alpine
 ---> 3036d4c4fcea
Step 2/5 : COPY package.json .
 ---> bec930afabf8
Step 3/5 : RUN npm install
 ---> Running in bc51bb7f118d

> grpc@1.11.0 install /node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.0/node-v64-linux-x64-musl.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.11.0 and node@10.0.0 (node-v64 ABI, musl) (falling back to source compile with node-gyp)
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:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397: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/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:149:21)
gyp ERR! System Linux 4.9.60-linuxkit-aufs
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=/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl"
gyp ERR! cwd /node_modules/grpc
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
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=/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:947:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
node-pre-gyp ERR! System Linux 4.9.60-linuxkit-aufs
node-pre-gyp ERR! command "/usr/local/bin/node" "/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /node_modules/grpc
node-pre-gyp ERR! node -v v10.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.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=/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl' (1)
npm WARN python_err@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.11.0 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.11.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@LaurentGoderre
Copy link
Member

9 Alpine definitely should not have Python installed. See #282 on how to fix this.

@jlafortune
Copy link
Author

Ah okay, I now see that the Alpine Dockerfile only temporarily installs Python with the --virtual flag. I should be able to fix with #282. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants