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

install-node-and-npm - Use local binary archive #1107

Open
venkateshkolisetty-ctl opened this issue Sep 15, 2023 · 1 comment
Open

install-node-and-npm - Use local binary archive #1107

venkateshkolisetty-ctl opened this issue Sep 15, 2023 · 1 comment

Comments

@venkateshkolisetty-ctl
Copy link

venkateshkolisetty-ctl commented Sep 15, 2023

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce.

Using <goal>install-node-and-npm</goal> and <nodeVersion>.
This is downloading from https://nodejs.org/dist

What is the expected behavior?

Take the binary file from repository.
Choose from a local file that will be available in the repository.

I have archives inside repository as

node-binary
    /v18.16.0
        /node-v18.16.0.tar.gz
        /node-v18.16.0-win-x64.zip

To make the plugin use local files instead of fetching from internet, I tried below configuration

<execution>
  <id>install-node-and-npm</id>
  <goals>
    <goal>install-node-and-npm</goal>
  </goals>
  <configuration>
    <nodeVersion>v18.16.0</nodeVersion>
    <nodeDownloadRoot>${project.baseUri}/node-binary/</nodeDownloadRoot>
  </configuration>
</execution>

This seems to be working in Windows

[INFO] --- frontend:1.14.0:install-node-and-npm (install-node-and-npm) @ emo-tools-frontend ---
[INFO] Installing node version v18.16.0
[INFO] Downloading file:///C:/Users/*******/repo/CATALOG/BMCM-emo-tools/emo-tools-frontend//node-binary/v18.16.0/node-v18.16.0-win-x64.zip to C:\Users\*******\.m2\repository\com\github\eirslett\node\18.16.0\node-18.16.0-win-x64.zip
[INFO] Unpacking C:\Users\*******\.m2\repository\com\github\eirslett\node\18.16.0\node-18.16.0-win-x64.zip into C:\Users\*******\repo\CATALOG\BMCM-emo-tools\emo-tools-frontend\node\tmp
[INFO] Copying node binary from C:\Users\*******\repo\CATALOG\BMCM-emo-tools\emo-tools-frontend\node\tmp\node-v18.16.0-win-x64\node.exe to C:\Users\*******\repo\CATALOG\BMCM-emo-tools\emo-tools-frontend\node\node.exe
[INFO] Installed node locally.
[INFO] 
[INFO] --- frontend:1.14.0:npm (npm-run-install) @ emo-tools-frontend ---
[INFO] Running 'npm install' in C:\Users\*******\repo\CATALOG\BMCM-emo-tools\emo-tools-frontend

But build is failing in Jenkins

[INFO] --- frontend:1.14.0:install-node-and-npm (install-node-and-npm) @ emo-tools-frontend ---
[INFO] Installing node version v18.16.0
[INFO] Downloading file:///app/jenkins/workspace/_tools_BMCM-emo-tools_PR-26-head/emo-tools-frontend//node-binary/v18.16.0/node-v18.16.0-linux-x64.tar.gz to /home/jenkins/.m2/repository/com/github/eirslett/node/18.16.0/node-18.16.0-linux-x64.tar.gz
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.14.0:install-node-and-npm (install-node-and-npm) on project emo-tools-frontend: Could not download Node.js: Could not download [file:////node-binary/v18.16.0/node-v18.16.0-linux-x64.tar.gz](file://node-binary/v18.16.0/node-v18.16.0-linux-x64.tar.gz): File system element for parameter 'source' does not exist: '/node-binary/v18.16.0/node-v18.16.0-linux-x64.tar.gz' -> [Help 1]

Please mention your frontend-maven-plugin and operating system version.
Windows 11 x64

@tmclane
Copy link

tmclane commented Feb 6, 2024

FYI:

If you rename your files as follows it will find them:

node-v18.16.0.tar.gz => node-18.16.0-linux-x64.tar.gz

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