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

npm run pkg failed due to No available node version #8686

Open
lzw06061139 opened this issue Jan 14, 2025 · 5 comments
Open

npm run pkg failed due to No available node version #8686

lzw06061139 opened this issue Jan 14, 2025 · 5 comments

Comments

@lzw06061139
Copy link

lzw06061139 commented Jan 14, 2025

Environment info

  • NooBaa Version: 5.18.0/5.17.1

Actual behavior

  1. run make pkg or make executable on the root directory of noobaa-core source code failed:

Error! No available node version satisfies 'node20'

Expected behavior

  1. make pkg or make excutable can complete successfully

Steps to reproduce

  1. clone the source code of noobaa-core from github
  2. (optional) git checkout v5.17.1
  3. run make pkg or make executable

More information - Screenshots / Logs / Other output

=> ERROR [7/7] RUN npm run pkg                                                                                                                                                                                                                                              0.8s 
------                                                                                                                                                                                                                                                                            
 > [7/7] RUN npm run pkg:                                                                                                                                                                                                                                                         
0.280                                                                                                                                                                                                                                                                             
0.280 > [email protected] pkg
0.280 > pkg . --public --options unhandled-rejections=warn --compress Brotli
0.280 
0.753 > [email protected]
0.753 compression:  Brotli
0.757 > Error! No available node version satisfies 'node20'
------
executable.Dockerfile:15
--------------------
  13 |     COPY config.js ./config.js
  14 |     COPY platform_restrictions.json ./platform_restrictions.json
  15 | >>> RUN npm run pkg
  16 |     
  17 |     ENTRYPOINT [ "/noobaa/build/noobaa-core" ]
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run pkg" did not complete successfully: exit code: 2
make: *** [Makefile:152: executable] Error 1
@liranmauda
Copy link
Contributor

Hi @lzw06061139

What version of node do you have?

Try this before:

nvm install
nvm list
nvm alias default $(cat .nvmrc)
npm run clean
npm install
npm run build

It will install the node version we set in the .nvmrc file, set it as the default, clean everything, install the modules, and then build the native.

after that, re-try: run make pkg or make executable

Let me know if it helps.

@lzw06061139
Copy link
Author

Hi @lzw06061139

What version of node do you have?

Try this before:

nvm install
nvm list
nvm alias default $(cat .nvmrc)
npm run clean
npm install
npm run build

It will install the node version we set in the .nvmrc file, set it as the default, clean everything, install the modules, and then build the native.

after that, re-try: run make pkg or make executable

Let me know if it helps.

Thanks for your reply. I tried the commands you listed above on my ubuntu(20.04), there are works well. But, after that, run 'npm run pkg' failed as before.

 [email protected] pkg
> pkg . --public --options unhandled-rejections=warn --compress Brotli

> [email protected]
compression:  Brotli
> Error! No available node version satisfies 'node20'

run 'make executable' again which calls the executable target in the Makefile, and build in the docker container, failed too.

@liranmauda
Copy link
Contributor

@guymguym @nimrod-becker
Do we support executables?

@nimrod-becker
Copy link
Contributor

Was not aware that someone was using it. @guymguym thoughts?

@lzw06061139
Copy link
Author

@guymguym @nimrod-becker Do we support executables?

I see there is executable taget in the make file as following:

noobaa: base
	@echo "\n##\033[1;32m Build image noobaa ...\033[0m"
	@echo "$(CONTAINER_ENGINE) build $(CONTAINER_PLATFORM_FLAG)"
	$(CONTAINER_ENGINE) build $(CONTAINER_PLATFORM_FLAG) $(CPUSET) --build-arg CENTOS_VER=$(CENTOS_VER) --build-arg BUILD_S3SELECT=$(BUILD_S3SELECT) --build-arg BUILD_S3SELECT_PARQUET=$(BUILD_S3SELECT_PARQUET) -f src/deploy/NVA_build/NooBaa.Dockerfile $(CACHE_FLAG) $(NETWORK_FLAG) -t noobaa --build-arg GIT_COMMIT=$(GIT_COMMIT) . $(REDIRECT_STDOUT)
	$(CONTAINER_ENGINE) tag noobaa $(NOOBAA_TAG)
	@echo "##\033[1;32m Build image noobaa done.\033[0m"
.PHONY: noobaa

executable: base
	@echo "\n##\033[1;32m Build image noobaa-core-executable ...\033[0m"
	$(CONTAINER_ENGINE) build $(CONTAINER_PLATFORM_FLAG) $(CPUSET) -f src/deploy/standalone/executable.Dockerfile $(CACHE_FLAG) $(NETWORK_FLAG) -t noobaa-core-executable --build-arg GIT_COMMIT=$(GIT_COMMIT) . $(REDIRECT_STDOUT)
	$(CONTAINER_ENGINE) build $(CONTAINER_PLATFORM_FLAG) $(CPUSET) -f src/deploy/standalone/export.Dockerfile $(CACHE_FLAG) $(NETWORK_FLAG) --build-arg GIT_COMMIT=$(GIT_COMMIT) . $(REDIRECT_STDOUT) --output /tmp/noobaa-core-executable/
	@echo "##\033[1;32m Build image noobaa-core-executable done.\033[0m"
.PHONY: executable

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