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

Use https://nodejs.org/ as defaultDownloadRoot #278

Closed
postmann opened this issue Sep 10, 2015 · 25 comments
Closed

Use https://nodejs.org/ as defaultDownloadRoot #278

postmann opened this issue Sep 10, 2015 · 25 comments

Comments

@postmann
Copy link

Currently, http://nodejs.org/dist/ redirects to https://nodejs.org/en/blog/. Adding

<nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>

to my pom.xml solved the problem. Maybe it would be an option to use the HTTPS URL by default?

@filip1323
Copy link

It does not solve my problem. I get:
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.23:install-node-and-npm (install node and npm) on project punchcard: Could not download Node.js from: https://nodejs.org/dist/v4.0.0/x64/node.exe: Got error code 404 from the server. -> [Help 1]
Maven 3.3.3
npm 2.14.2

I assume it should use
https://nodejs.org/dist/v4.0.0/win-x64/node.exe
not
https://nodejs.org/dist/v4.0.0/x64/node.exe

EDIT

I resolved it by using v0.12.7 of node with <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>

@postmann
Copy link
Author

@filip1323: This is AFAIK due to #276.

@SlevinBE
Copy link

Looks like this PR should fix this: https://github.com/eirslett/frontend-maven-plugin/pull/270/files

@ghost
Copy link

ghost commented Sep 10, 2015

I was able to download node from the new download root (https://nodejs.org/dist - but we are using node v0.10.36 and npm 2.3.0 and Oracle JDK 1.6

However, now I encounter this error from the build server where we are running IBM JDK 1.6

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.25:install-node-and-npm (install node) on project famsformff-client: Could not download Node.js: Could not download https://nodejs.org/dist/v0.10.36/node-v0.10.36-linux-x64.tar.gz: RSA premaster secret error: Illegal key size or default parameters -> [Help 1]

I discovered I just needed to update the security policy jars per this doc:

http://www-01.ibm.com/support/docview.wss?uid=swg21663373

and then my build worked successfully with the new https download roots

I'm using plugin version 0.0.25

@cecchisandrone
Copy link

What about npm downloadRoot? It tries to download from https://nodejs.org/dist/npm-1.4.21.tgz but file is not there anymore, neither in https://nodejs.org/dist/npm/. How did you change that?

@SlevinBE
Copy link

based on the sourcecode, it used http://registry.npmjs.org/npm/-/ by default for npm. So you have to specify the npm and nodejs download roots separately:

<nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
<npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>

@cecchisandrone
Copy link

Great, thanks!

@david-gang
Copy link

👍

@mriehema
Copy link
Contributor

They fixed the download repo links, see nodejs/nodejs.org#124
http should work again.

@fhemberger
Copy link

@eirslett You still may want to change this setting, as https will be the default from now on (saving you one 301 redirect).

@ghost
Copy link

ghost commented Sep 10, 2015

Thanks for the update downloading node from http://nodejs.org/dist/ is working again - what an adventure;)

@Katharsas
Copy link

Don't know if this is the right place to ask, but where do i fetch latest npm from? http://nodejs.org/dist/npm/ only has npm up to version 1.4.9, the current version is 3.3.3. Nodejs v4.1.1 ships with npm 2.14.3. All tutorials tell me "use the windows installer to get npm"...

Edit: Nevermind, http://registry.npmjs.org/npm/-/ is the way to go. Maybe update the Readme file?

@eirslett
Copy link
Owner

I think #270 solved this issue.
And yes, npm is now downloaded from npmjs.org, the readme is outdated.

@regi4life
Copy link

Hello,

Where i have to add the following lines :

https://nodejs.org/dist/
http://registry.npmjs.org/npm/-/

If i choose to download manually the file. Where should i put it for not having anymore the above error ?

For information, i am using maven for compiling a some code sources.

Thank you for your help.

Regi4life

@regi4life
Copy link

@SlevinBE

Where i have to define the informations you specify above ?

Thank you for your help.

Best regards,
Regi4life

@Katharsas
Copy link

You should have something similar to this in you pom:

<execution>
    <id>install node and npm</id>
    <goals>
        <goal>install-node-and-npm</goal>
    </goals>
    <phase>generate-resources</phase>
    <configuration>
        <nodeVersion>v4.1.1</nodeVersion>
        <npmVersion>3.3.3</npmVersion>
        <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
        <npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>
    </configuration>
</execution>

Complete pom here: https://github.com/Katharsas/GMM/blob/master/pom.xml

@regi4life
Copy link

Thank for replying quickly.

I have maybe a proxy problem.

ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.26:install-node-and-npm (install-node-and-npm) on project openam-ui-ria: Could not download Node.js from: https://nodejs.org/dist/v4.2.3/win-x86/node.exe: Could not download https://nodejs.org/dist/v4.2.3/win-x86/node.exe: Connect to nodejs.org:443 [nodejs.org/104.20.23.46, nodejs.org/104.20.22.46] failed: Connection timed out: connect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.26:install-node-and-npm (install-node-and-npm) on project openam-ui-ria: Could not download Node.js from: https://nodejs.org/dist/v4.2.3/win-x86/node.exe: Could not download https://nodejs.org/dist/v4.2.3/win-x86/node.exe
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Could i install Node.js manually in my maven?

Thank you for your help.

Best regards,
Regi4life

@Katharsas
Copy link

Yes you can.

Lets assume you have a config like this:

<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>0.0.26</version>
    <configuration>
        <workingDirectory>src/main/frontend</workingDirectory>
        <installDirectory>.</installDirectory>
    </configuration>
    <executions>
        <!-- Config from: https://github.com/eirslett/frontend-maven-plugin -->
        <!-- phase optional for all executions: default phase is "generate-resources" -->
        <!--  disable some of the following executions to improve build speed -->
        <execution>
            <id>install node and npm</id>
            <goals>
                <goal>install-node-and-npm</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
                <nodeVersion>v4.1.1</nodeVersion>
                <npmVersion>3.3.3</npmVersion>
                <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
                <npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>
            </configuration>
        </execution>
        <execution>
            <id>npm install</id>
            <goals>
                <goal>npm</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
                <arguments>install</arguments>
            </configuration>
        </execution>
        ...
    </executions>
</plugin>

You need to comment out the first execution (install-node-and-npm) and instead install node.js with npm manually.
Then manually install node.js and copy the installed folder to the same folder as is specified in <installDirectory> tag. In my case the path is . (the project folder). The folder must be named "node" and contain the node executable.

@regi4life
Copy link

It seems it is going better by just copying the "exe" in the "node" folder and when i rebuid, i have the details below :

[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:0.0.26:install-node-and-npm' with basic configurator -->
DEBUG installDirectory = D:\openam-13.0.0\openam-ui\openam-ui-ria
DEBUG nodeDownloadRoot = https://nodejs.org/dist/
DEBUG nodeVersion = v4.2.3
DEBUG npmDownloadRoot = http://maven.forgerock.org/repo/api/npm/npm-virtual/npm/-/
DEBUG npmVersion = 3.5.2
DEBUG session = org.apache.maven.execution.MavenSession@a56783
DEBUG skip = false
DEBUG skipTests = true
DEBUG workingDirectory = D:\openam-13.0.0\openam-ui\openam-ui-ria
DEBUG execution = com.github.eirslett:frontend-maven-plugin:0.0.26:install-node-and-npm {execution: install-node-and-npm}
[DEBUG] -- end configuration --
[INFO] Found proxies: [default{protocol='http', host='127.0.0.1', port=31280}]
[INFO] Node v4.2.3 is already installed.
[INFO] Installing npm version 3.5.2
[INFO] Downloading NPM from http://maven.forgerock.org/repo/api/npm/npm-virtual/npm/-/npm-3.5.2.tgz to D:\openam-13.0.0\openam-ui\openam-ui-ria\npm.tar.gz
[INFO] Downloading via proxy default{protocol='http', host='127.0.0.1', port=31280}
[INFO] Extracting NPM files in node/
[INFO] Unpacking D:\openam-13.0.0\openam-ui\openam-ui-ria\npm.tar.gz into D:\openam-13.0.0\openam-ui\openam-ui-ria/node/node_modules
[INFO] Installed NPM locally.
[INFO]
[INFO] --- frontend-maven-plugin:0.0.26:npm (npm-install) @ openam-ui-ria ---
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:0.0.26:npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:0.0.26, parent: sun.misc.Launcher$AppClassLoader@15d56d5]
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:0.0.26:npm' with basic configurator -->
DEBUG arguments = install
DEBUG installDirectory = D:\openam-13.0.0\openam-ui\openam-ui-ria
DEBUG session = org.apache.maven.execution.MavenSession@a56783
DEBUG skip = false
DEBUG skipTests = true
DEBUG workingDirectory = D:\openam-13.0.0\openam-ui\openam-ui-ria
DEBUG execution = com.github.eirslett:frontend-maven-plugin:0.0.26:npm {execution: npm-install}
[DEBUG] -- end configuration --
[INFO] Found proxies: [default{protocol='http', host='127.0.0.1', port=31280}]
[INFO] Running 'npm install --color=false --proxy=http://127.0.0.1:31280' in D:\openam-13.0.0\openam-ui\openam-ui-ria
[ERROR] npm WARN deprecated [email protected]: Grunt needs your help! See gruntjs/grunt#1403
[ERROR] npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0
[ERROR] npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0

@narayanai
Copy link

narayanai commented Sep 11, 2017

Hi,
I have a local repository for node and npm download links like the below..
https://abc.artifactory.com/dist/
http://abc.artifactory.com/npm/-/

And this artifactory links are password protected.. the credentials that I am using in settings.xml is not helpful here,and I an getting the error like

http://abc.artifactory.com/......./latest-v8.x/win-x86/node.exe: Got error code 401 from the server. -> [Help 1]
[ERROR]

However the link is valid and I am able to access the node.exe from the link. Could you please help me on this.

@pencale
Copy link

pencale commented Oct 11, 2017

Hi all, I am also using artifactory and getting 401 . I have serverid from settings.xml in configuration.

@senthilkumarselvakesavan
Copy link

senthilkumarselvakesavan commented Nov 17, 2017

Hi all,
I have the solution for this, It is working fine for me and the build got success.
Don't DO's:

  1. please do not add any new entry in pom.xml like the below

        ` <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
          <npmDownloadRoot>http://registry.npmjs.org/npm/-/</npmDownloadRoot>`
    
  2. It will append extra line to the actual url to download nodejs and npm.

DO's.

  1. please verify the URL return by maven logs in the browser.
  2. It should open the download path of nodejs
  3. you just add the network proxy in Maven's settings.xml file
    <proxies> <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>username</username> <password>password</password> <host>xxx.xx.xx.xx</host> <port>*****</port>port number <proxy> <proxies>
    Note: your company's network proxy and it's host, username, password details.
  4. mvn clean install , it will be downloaded and install automatically ... you can see the magic in Maven console.

I hope it will help you guys... :)

Regards,
Senthilkumar.S
RENAULT NISSAN-CHENNAI

@mariem13
Copy link

mariem13 commented Feb 5, 2018

hi, I have the same problem:
my pom.xml:

<configuration>
                   <nodeVersion>v6.11.3</nodeVersion>
                    <npmVersion>3.10.10</npmVersion>
                    <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
                    <workingDirectory>src/main/angularDash</workingDirectory>
                </configuration>

error:

Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.22:install-node-and-npm (install node and npm) on project dashAngular: Could not download Node.js from: https://nodejs.org/dist/v6.11.3/x64/node.exe: Got error code 404 from the server. -> [Help 1]

@mriehema
Copy link
Contributor

mriehema commented Feb 5, 2018

Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.22

@mariem13 please update from 0.0.22 to the latest version of the frontend-maven-plugin (1.6)

@mariem13
Copy link

mariem13 commented Feb 5, 2018

@mriehema Thx for reply, i tried with version 1.6 but it find new error in version of maven

Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) on project dashAngular: The plugin com.github.eirslett:frontend-maven-plugin:1.6 requires Maven version 3.1.0 -> [Help 1]

I use version 3.2.5

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