PhantomJS 下载失败问题
1. 错误分析
下面是完整的报错日志:
- [ERROR] npm verb unsafe-perm in lifecycle true
- [ERROR] npm verb unlock done using /root/.npm/_locks/phantomjs-ca2567298810d09d.lock for /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs
- [ERROR] npm verb unlock done using /root/.npm/_locks/core-js-29b3f75c7b038ece.lock for /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma/node_modules/core-js
- [ERROR] npm verb about to build /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma
- [ERROR] npm info build /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma
- [ERROR] npm info linkStuff karma@2.0.5
- [ERROR] npm verb linkBins karma@2.0.5
- [ERROR] npm verb link bins [ { karma: './bin/karma' },
- [ERROR] npm verb link bins '/opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/.bin',
- [ERROR] npm verb link bins false ]
- [ERROR] npm verb linkMans karma@2.0.5
- [ERROR] npm verb rebuildBundles karma@2.0.5
- [ERROR] npm verb gentlyRm don't care about contents; nuking /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/.bin/karma
- [ERROR] npm verb rebuildBundles [ '.bin',
- [ERROR] npm verb rebuildBundles 'bluebird',
- [ERROR] npm verb rebuildBundles 'body-parser',
- [ERROR] npm verb rebuildBundles 'chokidar',
- [ERROR] npm verb rebuildBundles 'colors',
- [ERROR] npm verb rebuildBundles 'combine-lists',
- [ERROR] npm verb rebuildBundles 'connect',
- [ERROR] npm verb rebuildBundles 'core-js',
- [ERROR] npm verb rebuildBundles 'di',
- [ERROR] npm verb rebuildBundles 'dom-serialize',
- [ERROR] npm verb rebuildBundles 'expand-braces',
- [ERROR] npm verb rebuildBundles 'glob',
- [ERROR] npm verb rebuildBundles 'graceful-fs',
- [ERROR] npm verb rebuildBundles 'http-proxy',
- [ERROR] npm verb rebuildBundles 'isbinaryfile',
- [ERROR] npm verb rebuildBundles 'lodash',
- [ERROR] npm verb rebuildBundles 'log4js',
- [ERROR] npm verb rebuildBundles 'mime',
- [ERROR] npm verb rebuildBundles 'minimatch',
- [ERROR] npm verb rebuildBundles 'optimist',
- [ERROR] npm verb rebuildBundles 'qjobs',
- [ERROR] npm verb rebuildBundles 'range-parser',
- [ERROR] npm verb rebuildBundles 'rimraf',
- [ERROR] npm verb rebuildBundles 'safe-buffer',
- [ERROR] npm verb rebuildBundles 'socket.io',
- [ERROR] npm verb rebuildBundles 'source-map',
- [ERROR] npm verb rebuildBundles 'tmp',
- [ERROR] npm verb rebuildBundles 'useragent' ]
- [ERROR] npm info install karma@2.0.5
- [ERROR] npm info postinstall karma@2.0.5
- [ERROR] npm verb unlock done using /root/.npm/_locks/karma-f241847ca8dea731.lock for /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma
- [ERROR] npm verb stack Error: phantomjs-prebuilt@2.1.16 install: `node install.js`
- [ERROR] npm verb stack Exit status 1
- [ERROR] npm verb stack at EventEmitter.<anonymous> (/opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node/node_modules/npm/lib/utils/lifecycle.js:217:16)
- [ERROR] npm verb stack at emitTwo (events.js:87:13)
- [ERROR] npm verb stack at EventEmitter.emit (events.js:172:7)
- [ERROR] npm verb stack at ChildProcess.<anonymous> (/opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node/node_modules/npm/lib/utils/spawn.js:24:14)
- [ERROR] npm verb stack at emitTwo (events.js:87:13)
- [ERROR] npm verb stack at ChildProcess.emit (events.js:172:7)
- [ERROR] npm verb stack at maybeClose (internal/child_process.js:829:16)
- [ERROR] npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
- [ERROR] npm verb pkgid phantomjs-prebuilt@2.1.16
- [ERROR] npm verb cwd /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web
- [ERROR] npm ERR! Linux 5.15.153.1-microsoft-standard-WSL2
- [ERROR] npm ERR! argv "/opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node/node" "/opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node/node_modules/npm/bin/npm-cli.js" "in
- stall" "--unsafe-perm" "--progress" "--save" "--verbose" "--registry=https://registry.npmmirror.com/"
- [ERROR] npm ERR! node v4.5.0
- [ERROR] npm ERR! npm v2.15.0
- [ERROR] npm ERR! code ELIFECYCLE
- [ERROR]
- [ERROR] npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
- [ERROR] npm ERR! Exit status 1
- [ERROR] npm ERR!
- [ERROR] npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script 'node install.js'.
- [ERROR] npm ERR! This is most likely a problem with the phantomjs-prebuilt package,
- [ERROR] npm ERR! not with npm itself.
- [ERROR] npm ERR! Tell the author that this fails on your system:
- [ERROR] npm ERR! node install.js
- [ERROR] npm ERR! You can get information on how to open an issue for this project with:
- [ERROR] npm ERR! npm bugs phantomjs-prebuilt
- [ERROR] npm ERR! Or if that isn't available, you can get their info via:
- [ERROR] npm ERR!
- [ERROR] npm ERR! npm owner ls phantomjs-prebuilt
- [ERROR] npm ERR! There is likely additional logging output above.
- [ERROR] npm verb exit [ 1, true ]
- [ERROR] npm verb unbuild node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt
- [ERROR] npm info preuninstall phantomjs-prebuilt@2.1.16
- [ERROR] npm info uninstall phantomjs-prebuilt@2.1.16
- [ERROR] npm verb unbuild rmStuff phantomjs-prebuilt@2.1.16 from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules
- [ERROR] npm verb unbuild rmStuff in /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma-phantomjs-launcher/node_modules
- [ERROR] npm verb gentlyRm vacuuming from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma-phantomjs-launcher/node_modules/.bin/phantomjs up to /opt/modules/ambari/ambari-a
- dmin/src/main/resources/ui/admin-web
- [ERROR] npm info postuninstall phantomjs-prebuilt@2.1.16
- [ERROR] npm verb gentlyRm don't care about contents; nuking /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt
- [ERROR] npm verb unbuild node_modules/karma-phantomjs-launcher
- [ERROR] npm info preuninstall karma-phantomjs-launcher@1.0.4
- [ERROR] npm info uninstall karma-phantomjs-launcher@1.0.4
- [ERROR] npm verb unbuild rmStuff karma-phantomjs-launcher@1.0.4 from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules
- [ERROR] npm info postuninstall karma-phantomjs-launcher@1.0.4
- [ERROR] npm verb gentlyRm don't care about contents; nuking /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma-phantomjs-launcher
- [ERROR] npm verb unbuild node_modules/phantomjs
- [ERROR] npm info preuninstall phantomjs@2.1.7
- [ERROR] npm info uninstall phantomjs@2.1.7
- [ERROR] npm verb unbuild rmStuff phantomjs@2.1.7 from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules
- [ERROR] npm verb gentlyRm vacuuming from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/.bin/phantomjs up to /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web
- [ERROR] npm info postuninstall phantomjs@2.1.7
- [ERROR] npm verb gentlyRm don't care about contents; nuking /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs
- [ERROR]
- [ERROR] npm ERR! Please include the following file with any support request:
- [ERROR] npm ERR! /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/npm-debug.log
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD FAILURE
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: 55.502 s
- [INFO] Finished at: 2024-10-24T01:16:25Z
- [INFO] ------------------------------------------------------------------------
- [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project ambari-admin: Failed to run task: 'npm install --unsafe-perm --progress --save --verbose --registry=
- https://registry.npmmirror.com/' failed. (error code 1) -> [Help 1]
- org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project ambari-admin: Failed to run task
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
- at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
- at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
- at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
- at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
- 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:282)
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
- at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
- Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run task
- at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute (AbstractFrontendMojo.java:95)
- at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
- at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
- at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
- at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
- at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
- 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:282)
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
- at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
- Caused by: com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException: 'npm install --unsafe-perm --progress --save --verbose --registry=https://registry.npmmirror.com/' failed. (error code 1)
- at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute (NodeTaskExecutor.java:60)
- at com.github.eirslett.maven.plugins.frontend.mojo.NpmMojo.execute (NpmMojo.java:62)
- at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute (AbstractFrontendMojo.java:89)
- at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
- at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
- at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
- at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
- at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
- 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:282)
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
- at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
- [ERROR]
- [ERROR]
- [ERROR] For more information about the errors and possible solutions, please read the following articles:
- [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
复制代码 1.1 错误定位
从日志中可以看出,phantomjs-prebuilt 在实验下载 phantomjs 文件时失败,导致安装中断。
2. 解决方案 |