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

Docker node-16 Fails to build #1965

Closed
niveKKumar opened this issue Jan 4, 2022 · 1 comment
Closed

Docker node-16 Fails to build #1965

niveKKumar opened this issue Jan 4, 2022 · 1 comment

Comments

@niveKKumar
Copy link

niveKKumar commented Jan 4, 2022

Issue or Feature

Build node project

Steps to Reproduce

FROM node:16
WORKDIR /app
COPY package.json ./
COPY tsconfig.json ./
COPY src ./src
RUN npm install
ENV GENERATE_SOURCEMAP=false
RUN npm run build
## this is stage two , where the app actually runs
FROM node:16
WORKDIR /app
COPY package.json ./
COPY secrets.json ./

RUN npm install --only=production
COPY src/public ./public
COPY --from=0 /app/dist /app

CMD ["node","index.js"]
#13 160.6 npm notice 
#13 160.6 npm notice New minor version of npm available! 8.1.2 -> 8.3.0
#13 160.6 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.3.0>
#13 160.6 npm notice Run `npm install -g npm@8.3.0` to update!
#13 160.6 npm notice 
#13 160.6 npm ERR! code 1
#13 160.6 npm ERR! path /app/node_modules/canvas
#13 160.6 npm ERR! command failed
#13 160.6 npm ERR! command sh -c node-pre-gyp install --fallback-to-build
#13 160.6 npm ERR! 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 --module=/app/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/app/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
#13 160.6 npm ERR! node-pre-gyp info it worked if it ends with ok
#13 160.6 npm ERR! node-pre-gyp info using node-pre-gyp@1.0.8
#13 160.6 npm ERR! node-pre-gyp info using node@16.13.1 | linux | arm64
#13 160.6 npm ERR! node-pre-gyp info build requesting source compile
#13 160.6 npm ERR! gyp info it worked if it ends with ok
#13 160.6 npm ERR! gyp info using node-gyp@8.3.0
#13 160.6 npm ERR! gyp info using node@16.13.1 | linux | arm64
#13 160.6 npm ERR! gyp info ok 
#13 160.6 npm ERR! gyp info it worked if it ends with ok
#13 160.6 npm ERR! gyp info using node-gyp@8.3.0
#13 160.6 npm ERR! gyp info using node@16.13.1 | linux | arm64
#13 160.6 npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
#13 160.6 npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
#13 160.6 npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
#13 160.6 npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
#13 160.6 npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
#13 160.6 npm ERR! gyp info spawn /usr/bin/python3
#13 160.6 npm ERR! gyp info spawn args [
#13 160.6 npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
#13 160.6 npm ERR! gyp info spawn args   'binding.gyp',
#13 160.6 npm ERR! gyp info spawn args   '-f',
#13 160.6 npm ERR! gyp info spawn args   'make',
#13 160.6 npm ERR! gyp info spawn args   '-I',
#13 160.6 npm ERR! gyp info spawn args   '/app/node_modules/canvas/build/config.gypi',
#13 160.6 npm ERR! gyp info spawn args   '-I',
#13 160.6 npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
#13 160.6 npm ERR! gyp info spawn args   '-I',
#13 160.6 npm ERR! gyp info spawn args   '/root/.cache/node-gyp/16.13.1/include/node/common.gypi',
#13 160.6 npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
#13 160.6 npm ERR! gyp info spawn args   '-Dvisibility=default',
#13 160.6 npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.13.1',
#13 160.6 npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
#13 160.6 npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.13.1/<(target_arch)/node.lib',
#13 160.6 npm ERR! gyp info spawn args   '-Dmodule_root_dir=/app/node_modules/canvas',
#13 160.6 npm ERR! gyp info spawn args   '-Dnode_engine=v8',
#13 160.6 npm ERR! gyp info spawn args   '--depth=.',
#13 160.6 npm ERR! gyp info spawn args   '--no-parallel',
#13 160.6 npm ERR! gyp info spawn args   '--generator-output',
#13 160.6 npm ERR! gyp info spawn args   'build',
#13 160.6 npm ERR! gyp info spawn args   '-Goutput_dir=.'
#13 160.6 npm ERR! gyp info spawn args ]
#13 160.6 npm ERR! Package pangocairo was not found in the pkg-config search path.
#13 160.6 npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
#13 160.6 npm ERR! to the PKG_CONFIG_PATH environment variable
#13 160.6 npm ERR! No package 'pangocairo' found
#13 160.6 npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
#13 160.6 npm ERR! gyp ERR! configure error 
#13 160.6 npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
#13 160.6 npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
#13 160.6 npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
#13 160.6 npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
#13 160.6 npm ERR! gyp ERR! System Linux 5.10.47-linuxkit
#13 160.6 npm ERR! 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" "--module=/app/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/app/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
#13 160.6 npm ERR! gyp ERR! cwd /app/node_modules/canvas
#13 160.6 npm ERR! gyp ERR! node -v v16.13.1
#13 160.6 npm ERR! gyp ERR! node-gyp -v v8.3.0
#13 160.6 npm ERR! gyp ERR! not ok 
#13 160.6 npm ERR! node-pre-gyp ERR! build error 
#13 160.6 npm ERR! 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 --module=/app/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/app/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
#13 160.6 npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/app/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
#13 160.6 npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
#13 160.6 npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
#13 160.6 npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
#13 160.6 npm ERR! node-pre-gyp ERR! System Linux 5.10.47-linuxkit
#13 160.6 npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
#13 160.6 npm ERR! node-pre-gyp ERR! cwd /app/node_modules/canvas
#13 160.6 npm ERR! node-pre-gyp ERR! node -v v16.13.1
#13 160.6 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
#13 160.6 npm ERR! node-pre-gyp ERR! not ok

Your Environment

  • canvas: 2.8.0
  • node-16
@zbjornson
Copy link
Collaborator

Please see the section on ARM in the troubleshooting guide:

If you have an ARM CPU

Prebuilds aren't available for ARM. Please see the wiki for guides on building from source. See also node-gfx/node-canvas-prebuilt#69.

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

No branches or pull requests

2 participants