刘俊凯 发表于 2024-12-12 14:22:10

【Ambari编译报错】phantomjs从github上下载失败导致无法编译的问题

PhantomJS 下载失败问题

1. 错误分析

下面是完整的报错日志:
npm verb unsafe-perm in lifecycle true
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
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
npm verb about to build /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma
npm info build /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma
npm info linkStuff karma@2.0.5
npm verb linkBins karma@2.0.5
npm verb link bins [ { karma: './bin/karma' },
npm verb link bins   '/opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/.bin',
npm verb link bins   false ]
npm verb linkMans karma@2.0.5
npm verb rebuildBundles karma@2.0.5
npm verb gentlyRm don't care about contents; nuking /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/.bin/karma
npm verb rebuildBundles [ '.bin',
npm verb rebuildBundles   'bluebird',
npm verb rebuildBundles   'body-parser',
npm verb rebuildBundles   'chokidar',
npm verb rebuildBundles   'colors',
npm verb rebuildBundles   'combine-lists',
npm verb rebuildBundles   'connect',
npm verb rebuildBundles   'core-js',
npm verb rebuildBundles   'di',
npm verb rebuildBundles   'dom-serialize',
npm verb rebuildBundles   'expand-braces',
npm verb rebuildBundles   'glob',
npm verb rebuildBundles   'graceful-fs',
npm verb rebuildBundles   'http-proxy',
npm verb rebuildBundles   'isbinaryfile',
npm verb rebuildBundles   'lodash',
npm verb rebuildBundles   'log4js',
npm verb rebuildBundles   'mime',
npm verb rebuildBundles   'minimatch',
npm verb rebuildBundles   'optimist',
npm verb rebuildBundles   'qjobs',
npm verb rebuildBundles   'range-parser',
npm verb rebuildBundles   'rimraf',
npm verb rebuildBundles   'safe-buffer',
npm verb rebuildBundles   'socket.io',
npm verb rebuildBundles   'source-map',
npm verb rebuildBundles   'tmp',
npm verb rebuildBundles   'useragent' ]
npm info install karma@2.0.5
npm info postinstall karma@2.0.5
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
npm verb stack Error: phantomjs-prebuilt@2.1.16 install: `node install.js`
npm verb stack Exit status 1
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)
npm verb stack   at emitTwo (events.js:87:13)
npm verb stack   at EventEmitter.emit (events.js:172:7)
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)
npm verb stack   at emitTwo (events.js:87:13)
npm verb stack   at ChildProcess.emit (events.js:172:7)
npm verb stack   at maybeClose (internal/child_process.js:829:16)
npm verb stack   at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm verb pkgid phantomjs-prebuilt@2.1.16
npm verb cwd /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web
npm ERR! Linux 5.15.153.1-microsoft-standard-WSL2
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/"
npm ERR! node v4.5.0
npm ERR! npmv2.15.0
npm ERR! code ELIFECYCLE

npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!   node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!   npm bugs phantomjs-prebuilt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!   npm owner ls phantomjs-prebuilt
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]
npm verb unbuild node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt
npm info preuninstall phantomjs-prebuilt@2.1.16
npm info uninstall phantomjs-prebuilt@2.1.16
npm verb unbuild rmStuff phantomjs-prebuilt@2.1.16 from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules
npm verb unbuild rmStuff in /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/karma-phantomjs-launcher/node_modules
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
npm info postuninstall phantomjs-prebuilt@2.1.16
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
npm verb unbuild node_modules/karma-phantomjs-launcher
npm info preuninstall karma-phantomjs-launcher@1.0.4
npm info uninstall karma-phantomjs-launcher@1.0.4
npm verb unbuild rmStuff karma-phantomjs-launcher@1.0.4 from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules
npm info postuninstall karma-phantomjs-launcher@1.0.4
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
npm verb unbuild node_modules/phantomjs
npm info preuninstall phantomjs@2.1.7
npm info uninstall phantomjs@2.1.7
npm verb unbuild rmStuff phantomjs@2.1.7 from /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules
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
npm info postuninstall phantomjs@2.1.7
npm verb gentlyRm don't care about contents; nuking /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs

npm ERR! Please include the following file with any support request:
npm ERR!   /opt/modules/ambari/ambari-admin/src/main/resources/ui/admin-web/npm-debug.log
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time:55.502 s
Finished at: 2024-10-24T01:16:25Z
------------------------------------------------------------------------
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) ->
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)


For more information about the errors and possible solutions, please read the following articles:
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

1.1 错误定位

从日志中可以看出,phantomjs-prebuilt 在实验下载 phantomjs 文件时失败,导致安装中断。
https://i-blog.csdnimg.cn/direct/490ca371d5e4497cb3421b24a51fdaf0.png
2. 解决方案
页: [1]
查看完整版本: 【Ambari编译报错】phantomjs从github上下载失败导致无法编译的问题