【问题标题】:MAVEN Build failure do to node permission deniedMAVEN 构建失败对节点权限被拒绝
【发布时间】:2021-08-01 02:14:42
【问题描述】:

在本地构建项目时,UI 应用程序出现构建失败,这似乎与 NPM 有关。 不确定它是否与 Node 或有关 JDK 的一些 Java 问题有关。关于这个问题的任何信息?

是否有一些我必须更改的内部权限配置?

sh: /Users/test.gc/Desktop/git/test-dot-com/test-dot-com/ui.apps/node_modules/.bin/npm-run-all: Permission denied

[ERROR] Command execution failed.

org.apache.commons.exec.ExecuteException: Process exited with an error: 126 (Exit value: 126)

    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)

    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)

    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:804)

    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:751)

    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:313)

    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:957)

    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)

    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)

    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)

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary for jll-dot-com 21.5.0:

[INFO] 

[INFO] jll-dot-com ........................................ SUCCESS [  0.246 s]

[INFO] jll-dot-com - Core ................................. SUCCESS [ 15.429 s]

[INFO] jll-dot-com - Groovy Console Extension ............. SUCCESS [  0.933 s]

[INFO] jll-dot-com - UI apps .............................. FAILURE [  8.991 s]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  26.590 s

[INFO] Finished at: 2021-05-10T08:57:09-07:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (npm-run-build) on project jll-dot-com.ui.apps: Command execution failed.: Process exited with an error: 126 (Exit value: 126) -> [Help 1]

[ERROR] 

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[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/MojoExecutionException

[ERROR] 

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <args> -rf :jll-dot-com.ui.apps

完成此构建没有失败的步骤是什么。

【问题讨论】:

  • 如果您使用签出文件的用户执行命令,您应该没有问题。与ls -la 联系以查看谁拥有该目录。另外,尝试删除 node_modules 目录并让 maven build 重新创建它。

标签: java maven npm build aem


【解决方案1】:
sh: /Users/test.gc/Desktop/git/test-dot-com/test-dot-com/ui.apps/node_modules/.bin/npm-run-all: Permission denied

第一行说明了一切。

我建议你尝试直接在代码仓库中使用 npm 运行相同的命令,看看你获得了什么样的权限。

npx npm-run-all

每个文件都有 3 个属性:Read、Write 和 Execute

total 0
0 drwx------@  6 samuel  staff   192 Apr 27 17:28 Applications

您可能没有执行该文件的权限。这可能是由许多可能的原因引起的。例如,如果您下载,则复制并粘贴它们。如果确实是权限不足导致的权限问题,可以使用如下命令修改权限。

chmod +x YOUR_REPO_DIR/.bin/*

这将授予命令的执行权限。

【讨论】:

  • 我应该在哪里添加这个命令? "chmod +x /.bin/* "
  • 运行该命令时找不到匹配项
  • 进入代码仓库后,执行命令chmod +x .bin/*(抱歉之前打错字了)
猜你喜欢
  • 2013-12-10
  • 1970-01-01
  • 2018-11-16
  • 2019-09-14
  • 2017-01-12
  • 2015-03-25
  • 2014-11-04
  • 2012-03-27
  • 1970-01-01
相关资源
最近更新 更多