Shashank3736/captcha-canvas

errors in docker

nick8kond opened this issue · 1 comments

Dockerfile:

`FROM node:20.9.0

WORKDIR /bots/app

COPY . .

RUN npm i && npm run build

CMD [ "node", "dist/main" ]`

Errors:

npm ERR! code 1
8.553 npm ERR! path /bots/app/node_modules/skia-canvas
8.554 npm ERR! command failed
8.554 npm ERR! command sh -c node-pre-gyp install || npm run build -- --release
8.554 npm ERR! response status 403 Forbidden on https://skia-canvas.s3.us-east-1.amazonaws.com/v1.0.1/linux-arm64-napi-v6-glibc.tar.gz
8.554 npm ERR!
8.554 npm ERR! > skia-canvas@1.0.1 build
8.554 npm ERR! > cargo-cp-artifact -nc lib/v6/index.node -- cargo build --message-format=json-render-diagnostics --release
8.554 npm ERR! node-pre-gyp info it worked if it ends with ok
8.554 npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
8.554 npm ERR! node-pre-gyp info using node@20.9.0 | linux | arm64
8.555 npm ERR! node-pre-gyp info check checked for "/bots/app/node_modules/skia-canvas/lib/v6/index.node" (not found)
8.555 npm ERR! node-pre-gyp http GET https://skia-canvas.s3.us-east-1.amazonaws.com/v1.0.1/linux-arm64-napi-v6-glibc.tar.gz
8.555 npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://skia-canvas.s3.us-east-1.amazonaws.com/v1.0.1/linux-arm64-napi-v6-glibc.tar.gz
8.555 npm ERR! node-pre-gyp ERR! install error
8.555 npm ERR! node-pre-gyp ERR! stack Error: response status 403 Forbidden on https://skia-canvas.s3.us-east-1.amazonaws.com/v1.0.1/linux-arm64-napi-v6-glibc.tar.gz
8.555 npm ERR! node-pre-gyp ERR! stack at /bots/app/node_modules/@mapbox/node-pre-gyp/lib/install.js:67:15
8.555 npm ERR! node-pre-gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
8.555 npm ERR! node-pre-gyp ERR! System Linux 6.4.16-linuxkit
8.555 npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/bots/app/node_modules/.bin/node-pre-gyp" "install"
8.555 npm ERR! node-pre-gyp ERR! cwd /bots/app/node_modules/skia-canvas
8.555 npm ERR! node-pre-gyp ERR! node -v v20.9.0
8.555 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
8.555 npm ERR! node-pre-gyp ERR! not ok
8.555 npm ERR! Error: could not find the cargo executable.
8.555 npm ERR!
8.555 npm ERR! You can find instructions for installing Rust and Cargo at:
8.555 npm ERR!
8.555 npm ERR! https://www.rust-lang.org/tools/install
8.555 npm ERR!
8.555 npm ERR!
8.555 npm ERR! Did not copy "cdylib:skia-canvas"
8.556
8.556 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-11-14T18_57_59_368Z-debug-0.log

failed to solve: process "/bin/sh -c npm i && npm run build" did not complete successfully: exit code: 1

Well what can I say skia-canvas is the problem here. I recommend you install v2 of this package as that supports canvas which has better support.

npm i captcha-canvas@2.3.1

I will try to solve these issues by pushing canvas as the main model.