eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 867 forks source link

nodeDownloadRoot and node.version #1083

Open mash-sap opened 1 year ago

mash-sap commented 1 year ago

We experience the following problem during the node installation (install-node-and-npm). The lookup for the node.exe fails due to a mismatch of the node-version and folder structure of the node archive/zip. Is there a configuration to resolve this?

Current setup: nodeDownloadRoot=https://our.server/org/nodejs/download/node/node node.version= 16.19.0

Download is done from: https://our.server/org/nodejs/download/node/node/16.19.0/node-16.19.0-win-x64.zip

After unpacking the archive we get following error: [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.2:install-node-and-npm (install-node-and-npm) on project my-project: Could not install Node: Could not find the downloaded Node.js binary in C:\my-project\node\tmp\node-16.19.0-win-x64\node.exe

Expected location: C:\my-project\node\tmp\node-16.19.0-win-x64\node.exe Actual location: C:\my-project\node\tmp\node-v16.19.0-win-x64\node.exe

Looks like that the plugin is using the provided node.version for the download and the file location lookup, which is not working in this case. Do you have any suggestion how we can point the expected location to the correct location?

mash-sap commented 1 year ago

Any ideas how to resolve this?

eirslett commented 1 year ago

Try using a v before the version number? v16.19.0

mash-sap commented 1 year ago

Try using a v before the version number? v16.19.0

Thanks for the suggestion, Eirik. Do you mean to provide the following? node.version= v16.19.0

This would create following downloadURL which will result in HTTP 404: https://our.server/org/nodejs/download/node/node/v16.19.0/node-v16.19.0-win-x64.zip

I think the problem is, that the archive file contains the v in its folder structure while the download URL does not contain the v

eirslett commented 1 year ago

Maybe your server is set up with the wrong URL path?

mash-sap commented 1 year ago

Maybe your server is set up with the wrong URL path?

That's exactly the issue. Is there any options in the plugin to work around this problem?

eirslett commented 1 year ago

There is no option in the plugin. You'll have to change your own proxy server, so that the URL structure is exactly the same as on nodejs.org.