【问题标题】:CreateProcess error=193, %1 is not a valid Win32 application -> [Help 1]CreateProcess 错误=193,%1 不是有效的 Win32 应用程序 -> [帮助 1]
【发布时间】:2017-03-16 09:17:26
【问题描述】:

在 maven 中运行 exec-npm-update 时,出现以下错误 CreateProcess 错误=193,%1 不是有效的 Win32 应用程序 -> [帮助 1]

以下是 pom 文件中的 sn-p。

<execution>
                <id>exec-npm-update</id>
                <phase>generate-sources</phase>
                <configuration>
                  <workingDirectory>${uiResourcesDir}</workingDirectory>
                  <executable>npm</executable>
                  <arguments>
                    <argument>update</argument>
                  </arguments>
                </configuration>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>

【问题讨论】:

    标签: angularjs node.js maven


    【解决方案1】:

    出现这个问题是因为我使用的 Angular 版本是 1.5。

    将可执行文件从 npm 更改为 npm.cmd 解决了问题!

    <execution>
                    <id>exec-npm-update</id>
                    <phase>generate-sources</phase>
                    <configuration>
                      <workingDirectory>${uiResourcesDir}</workingDirectory>
                      <executable>npm.cmd</executable>
                      <arguments>
                        <argument>update</argument>
                      </arguments>
                    </configuration>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </execution>
    

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题,回答你需要提供 npm.cmd 而不是 npm

      【讨论】:

      【解决方案3】:

      如果您喜欢在不考虑环境的情况下运行 shell 或命令提示符命令。我说的是 npm.cmd (windows)、npm.sh (linux) 部分。

      将 maven-exec-plugin 降级到 1.4.0 版,以便您只需提及(例如)

      <executable>npm</executable>
      <executable>ng</executable>
      

      【讨论】:

        猜你喜欢
        • 2017-01-07
        • 1970-01-01
        • 1970-01-01
        • 2012-09-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多