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

Error in sdrangelcli #54

Open
777petruh opened this issue Jul 18, 2024 · 2 comments
Open

Error in sdrangelcli #54

777petruh opened this issue Jul 18, 2024 · 2 comments

Comments

@777petruh
Copy link

I'm trying to make sdrangelcli.
I have a clean ubuntu 24.04 on a virtual machine.
When I build /sdrangel-docker/sdrangelcli.
And I get errors.

[+] Building 88.9s (13/14) docker:default
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 899B 0.0s
=> [internal] load metadata for docker.io/library/node:16-slim 2.1s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 89B 0.0s
=> [base 1/7] FROM docker.io/library/node:16-slim@sha256:3ebf2875c188d22939c6ab080cfb1a4a6248cc86bae600ea8e2326aa03acdb8f 0.0s
=> CACHED [base 2/7] RUN apt-get update && apt-get -y install sudo git 0.0s
=> CACHED [base 3/7] RUN npm install -g @angular/cli && npm install -g http-server 0.0s
=> CACHED [base 4/7] RUN usermod -a -G sudo node && usermod --shell /bin/bash node 0.0s
=> CACHED [base 5/7] RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 0.0s
=> CACHED [base 6/7] RUN sudo mkdir /opt/build && sudo chown node:node /opt/build 0.0s
=> CACHED [base 7/7] WORKDIR /opt/build 0.0s
=> [sdrangelcli 1/4] RUN git clone https://github.com/f4exb/sdrangelcli.git -b master sdrangelcli && echo "Thu Jul 18 03:24:51 PM UTC 7.0s
=> [sdrangelcli 2/4] WORKDIR /opt/build/sdrangelcli 0.1s
=> ERROR [sdrangelcli 3/4] RUN npm install && ng build --configuration production && mv dist /opt/build && rm -rf * 79.0s

[sdrangelcli 3/4] RUN npm install && ng build --configuration production && mv dist /opt/build && rm -rf *:
3.453 npm WARN EBADENGINE Unsupported engine {
3.456 npm WARN EBADENGINE package: '@angular-devkit/[email protected]',
3.456 npm WARN EBADENGINE required: {
3.456 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.456 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.456 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.456 npm WARN EBADENGINE },
3.456 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.457 npm WARN EBADENGINE }
3.458 npm WARN EBADENGINE Unsupported engine {
3.460 npm WARN EBADENGINE package: '@angular-devkit/[email protected]',
3.460 npm WARN EBADENGINE required: {
3.460 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.460 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.460 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.460 npm WARN EBADENGINE },
3.460 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.460 npm WARN EBADENGINE }
3.460 npm WARN EBADENGINE Unsupported engine {
3.460 npm WARN EBADENGINE package: '@angular-devkit/[email protected]',
3.460 npm WARN EBADENGINE required: {
3.460 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.460 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.460 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.460 npm WARN EBADENGINE },
3.460 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.460 npm WARN EBADENGINE }
3.460 npm WARN EBADENGINE Unsupported engine {
3.460 npm WARN EBADENGINE package: '@angular-devkit/[email protected]',
3.460 npm WARN EBADENGINE required: {
3.460 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.460 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.460 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.460 npm WARN EBADENGINE },
3.460 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.460 npm WARN EBADENGINE }
3.461 npm WARN EBADENGINE Unsupported engine {
3.462 npm WARN EBADENGINE package: '@angular-devkit/[email protected]',
3.463 npm WARN EBADENGINE required: {
3.463 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.463 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.464 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.464 npm WARN EBADENGINE },
3.464 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.464 npm WARN EBADENGINE }
3.464 npm WARN EBADENGINE Unsupported engine {
3.466 npm WARN EBADENGINE package: '@angular-devkit/[email protected]',
3.466 npm WARN EBADENGINE required: {
3.466 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.466 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.466 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.466 npm WARN EBADENGINE },
3.466 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.466 npm WARN EBADENGINE }
3.466 npm WARN EBADENGINE Unsupported engine {
3.466 npm WARN EBADENGINE package: '@angular/[email protected]',
3.466 npm WARN EBADENGINE required: {
3.466 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.466 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.466 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.466 npm WARN EBADENGINE },
3.466 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.466 npm WARN EBADENGINE }
3.468 npm WARN EBADENGINE Unsupported engine {
3.469 npm WARN EBADENGINE package: '@ngtools/[email protected]',
3.469 npm WARN EBADENGINE required: {
3.469 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.469 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.469 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.469 npm WARN EBADENGINE },
3.469 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.469 npm WARN EBADENGINE }
3.470 npm WARN EBADENGINE Unsupported engine {
3.471 npm WARN EBADENGINE package: '@schematics/[email protected]',
3.471 npm WARN EBADENGINE required: {
3.471 npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0',
3.471 npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6',
3.471 npm WARN EBADENGINE yarn: '>= 1.13.0'
3.471 npm WARN EBADENGINE },
3.471 npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
3.471 npm WARN EBADENGINE }
12.11 npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
15.28 npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
16.19 npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
16.89 npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
22.07 npm WARN deprecated [email protected]: this library is no longer supported
22.33 npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
30.78 npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
31.70 npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
33.55 npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
34.49 npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
45.16 npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see palantir/tslint#4534 for more information.
77.71
77.71 added 1467 packages, and audited 1468 packages in 1m
77.71
77.71 92 packages are looking for funding
77.71 run npm fund for details
77.90
77.90 83 vulnerabilities (1 low, 54 moderate, 22 high, 6 critical)
77.90
77.90 To address issues that do not require attention, run:
77.90 npm audit fix
77.90
77.90 To address all issues (including breaking changes), run:
77.90 npm audit fix --force
77.90
77.90 Run npm audit for details.
77.90 npm notice
77.90 npm notice New major version of npm available! 8.19.4 -> 10.8.2
77.90 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
77.90 npm notice Run npm install -g [email protected] to update!
77.90 npm notice
78.06 Node.js version v16.20.2 detected.
78.06 The Angular CLI requires a minimum Node.js version of v18.19.
78.06
78.06 Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
78.06


2 warnings found (use --debug to expand):

  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
  • FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 19)
    Dockerfile:25

24 | WORKDIR /opt/build/sdrangelcli
25 | >>> RUN npm install
26 | >>> && ng build --configuration production
27 | >>> && mv dist /opt/build
28 | >>> && rm -rf *
29 |

ERROR: failed to solve: process "/bin/sh -c npm install && ng build --configuration production && mv dist /opt/build && rm -rf *" did not complete successfully: exit code: 3

What could be the problem?

@MOS6522
Copy link

MOS6522 commented Aug 5, 2024

This appears to be a problem with Angular and the base version of the node image. Updating to 18-slim will allow Angular to run, but it will fail in build due to some legacy issues. There has to be a line added after line 24 before the RUN npm install command, that says "ENV NODE_OPTIONS=--openssl-legacy-provider", this will let Angular build the code.

The "as" is just simple case issue, capitalize it.

I haven't tested my changes yet, but wanted to inform the dev community here that there seems to be a breaking change in the build through the "@angular/cli" in npm.

@wmehilos
Copy link

wmehilos commented Sep 1, 2024

Confirmed that the following changes to the Dockerfile allow a successful build.sh execution on Debian 12/Bookworm on a Pi 4:

Line 1: change 'as' to 'AS'. Change 'node:16-slim' to 'node:18-slim'
Line 19: change 'as' to 'AS'
Line 24: Add new line and enter 'ENV=--openssl-legacy-provider'

FROM node:18-slim AS base

# Install base packages
RUN apt-get update && apt-get -y install sudo git
RUN npm install -g @angular/cli \
    && npm install -g http-server

# Give node user sudo rights and default to it
RUN usermod -a -G sudo node \
    && usermod --shell /bin/bash node
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER node

RUN sudo mkdir /opt/build \
    && sudo chown node:node /opt/build
WORKDIR /opt/build

# Clone sdrangelcli and build final image
FROM base AS sdrangelcli
ARG branch
ARG clone_label
RUN git clone https://github.com/f4exb/sdrangelcli.git -b ${branch} sdrangelcli \
    && echo "${clone_label}" > /dev/null
WORKDIR /opt/build/sdrangelcli
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN npm install \
    && ng build --configuration production \
    && mv dist /opt/build \
    && rm -rf *

WORKDIR /opt/build/dist/sdrangelcli
ENTRYPOINT [ "http-server" ]

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

3 participants