Jhipster应用:与maven包装时的凉亭问题

时间:2018-02-07 08:12:51

标签: bower jhipster

我正在开发一个Jhipster应用程序(v3.0.0)。 我知道这是一个旧版本,但也许有人遇到过这个问题 我试过安装了凉亭   - 纱线
  - npm(使用sudo,否则我无法安装它,我收到了EACCESS问题)

当我打包我的webapp时,我收到此错误:

[INFO] --------------------------------------
[INFO]          BOWER INSTALL --NO-COLOR
[INFO] --------------------------------------
bower ESUDO         Cannot be run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using --allow-root option
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.224 s
[INFO] Finished at: 2018-02-07T09:07:37+01:00
[INFO] Final Memory: 49M/517M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.trecloux:yeoman-maven-plugin:0.5:build (run-frontend-build) on project rh-app: Error during : bower install --no-color: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.trecloux:yeoman-maven-plugin:0.5:build (run-frontend-build) on project rh-app: Error during : bower install --no-color
    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:147)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error during : bower install --no-color
    at com.github.trecloux.yeoman.YeomanMojo.executeCommand(YeomanMojo.java:129)
    at com.github.trecloux.yeoman.YeomanMojo.logAndExecuteCommand(YeomanMojo.java:110)
    at com.github.trecloux.yeoman.YeomanMojo.bowerInstall(YeomanMojo.java:91)
    at com.github.trecloux.yeoman.YeomanMojo.execute(YeomanMojo.java:69)
    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: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147)
    at com.github.trecloux.yeoman.YeomanMojo.executeCommand(YeomanMojo.java:127)
    ... 31 more

我不知道如何解决它。
如果有人有想法......

由于

1 个答案:

答案 0 :(得分:2)

要以get用户身份运行bower,您需要在set(位于项目的根目录)中添加root

allow_root

作为旁注,在使用NPM安装软件包时不应使用sudo。请参阅"How to Prevent Permissions Errors"

上的NPM文档