frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

Goal install-node-and-npm fails on npm 4.0.5

Open guyaloni30 opened this issue 8 years ago • 5 comments

Short story: It looks like the link to download npm is broken. Downloading from http://registry.npmjs.org/npm/-/npm-v4.0.5.tgz returns this: {"code": "InternalError","message": "options.uri is a required argument"}

Long story: Plugin configuration: <plugin>     <groupId>com.github.eirslett</groupId>     <artifactId>frontend-maven-plugin</artifactId>     <version>1.3</version>     <executions>         <execution>             <goals>                 <goal>install-node-and-npm</goal>             </goals>             <phase>generate-sources</phase>         </execution>         <execution>             <phase>generate-sources</phase>             <id>build</id>             <goals>                 <goal>npm</goal>             </goals>             <configuration>                 <arguments>run build</arguments>             </configuration>         </execution>     </executions>     <configuration>         <installDirectory>../../..</installDirectory>         <workingDirectory>src/main</workingDirectory>         <nodeVersion>v6.9.1</nodeVersion>         <npmVersion>v4.0.5</npmVersion>     </configuration> </plugin>

I run maven with -X and I see: [DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.3, parent: sun.misc.Launcher$AppClassLoader@5c647e05] [DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm' with basic configurator --> [DEBUG] (f) installDirectory = C:\dev\9_2 [DEBUG] (f) nodeDownloadRoot = https://nodejs.org/dist/ [DEBUG] (f) nodeVersion = v6.9.1 [DEBUG] (f) npmDownloadRoot = http://registry.npmjs.org/npm/-/ [DEBUG] (f) npmVersion = v4.0.5 [DEBUG] (f) project = MavenProject: com.aternity.server:management-webapp:8.1-SNAPSHOT @ C:\dev\9_2\webapp\web\management-webapp\pom.xml [DEBUG] (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@60f9dc7e [DEBUG] (f) session = org.apache.maven.execution.MavenSession@63cf9de0 [DEBUG] (f) skip = false [DEBUG] (f) skipTests = false [DEBUG] (f) workingDirectory = C:\dev\9_2\webapp\web\management-webapp\src\main [DEBUG] (f) execution = com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm {execution: default} [DEBUG] -- end configuration -- [INFO] Installing node version v6.9.1 [DEBUG] Creating install directory C:\dev\9_2\node [INFO] Downloading https://nodejs.org/dist/v6.9.1/win-x64/node.exe to C:\Users\guy.m2\repository\com\github\eirslett\node\6.9.1\node-6.9.1-win-x64.exe [INFO] No proxies configured [INFO] No proxy was configured, downloading directly [INFO] Copying node binary from C:\Users\guy.m2\repository\com\github\eirslett\node\6.9.1\node-6.9.1-win-x64.exe to C:\dev\9_2\node\node.exe [INFO] Installed node locally. [INFO] Installing npm version v4.0.5 [INFO] Downloading http://registry.npmjs.org/npm/-/npm-v4.0.5.tgz to C:\Users\guy.m2\repository\com\github\eirslett\npm\4.0.5\npm-4.0.5.tar.gz [INFO] No proxies configured [INFO] No proxy was configured, downloading directly [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 26.392 s [INFO] Finished at: 2017-01-11T11:20:15+02:00 [INFO] Final Memory: 42M/619M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm (default) on project management-webapp: Could not download npm: Got error code 500 from the server. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm (default) on project management-webapp: Could not download npm: Got error code 500 from the server.     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:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     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)     at org.codehaus.classworlds.Launcher.main(Launcher.java:47)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) Caused by: org.apache.maven.plugin.MojoFailureException: Could not download npm: Got error code 500 from the server.     at com.github.eirslett.maven.plugins.frontend.mojo.MojoUtils.toMojoFailureException(MojoUtils.java:27)     at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:97)     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)     ... 26 more Caused by: com.github.eirslett.maven.plugins.frontend.lib.InstallationException: Could not download npm     at com.github.eirslett.maven.plugins.frontend.lib.NPMInstaller.installNpm(NPMInstaller.java:167)     at com.github.eirslett.maven.plugins.frontend.lib.NPMInstaller.install(NPMInstaller.java:82)     at com.github.eirslett.maven.plugins.frontend.mojo.InstallNodeAndNpmMojo.execute(InstallNodeAndNpmMojo.java:106)     at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:89)     ... 28 more Caused by: com.github.eirslett.maven.plugins.frontend.lib.DownloadException: Got error code 500 from the server.     at com.github.eirslett.maven.plugins.frontend.lib.DefaultFileDownloader.download(FileDownloader.java:68)     at com.github.eirslett.maven.plugins.frontend.lib.NPMInstaller.downloadFile(NPMInstaller.java:199)     at com.github.eirslett.maven.plugins.frontend.lib.NPMInstaller.downloadFileIfMissing(NPMInstaller.java:192)     at com.github.eirslett.maven.plugins.frontend.lib.NPMInstaller.installNpm(NPMInstaller.java:124)     ... 31 more [ERROR] [ERROR]

guyaloni30 avatar Jan 11 '17 09:01 guyaloni30

$ curl http://registry.npmjs.org/npm/-/npm-v4.0.5.tgz -i
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Cache-Control: max-age=0
Content-Length: 71
Accept-Ranges: bytes
Date: Wed, 11 Jan 2017 12:26:04 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-bma7020-BMA
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1484137562.754235,VS0,VE1761

{"code":"InternalError","message":"options.uri is a required argument"}

Looks like the download URL is wrong... I'm not sure what the correct URL should be. (Probably a problem with this plugin)

eirslett avatar Jan 11 '17 12:01 eirslett

I checked the response from https://registry.npmjs.org/npm and saw that the link has changed: From http://registry.npmjs.org/npm/-/npm-v4.0.5.tgz To: http://registry.npmjs.org/npm/-/npm-4.0.5.tgz (remove the "v" prefix of the version). @eirslett, Can I configure the plugin or do we need a new plugin version? Thanks, Guy

guyaloni30 avatar Jan 16 '17 07:01 guyaloni30

It would be great to enable custom url, not just the root.

jan-krakora avatar Jan 27 '17 13:01 jan-krakora

I am stuck with this same issue! Downloading npm fails because of the URL mismatch. Is there a fix or workaround for this? Thanks.

nagarajanchinnasamy avatar Feb 04 '17 09:02 nagarajanchinnasamy

remove from npmVersion v4.0.5 npmVersion v

tpfennig avatar Mar 01 '17 15:03 tpfennig