首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用maven-exec-plugin for npm clean?

如何使用maven-exec-plugin for npm clean?
EN

Stack Overflow用户
提问于 2019-09-25 17:47:55
回答 1查看 1K关注 0票数 1

我正在使用exec-maven-plugin。我有npm install和npm clean的扩展。下面是我在pom文件中的插件部分。它包含npm install、tsc run和npm clean的扩展。

代码语言:javascript
运行
复制
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <executions>

      <execution>
        <id>npm run clean (clean)</id>
        <goals>
          <goal>exec</goal>
        </goals>
        <phase>clean</phase>
        <configuration>
          <workingDirectory>./src/</workingDirectory>
          <executable>npm</executable>
          <arguments>
            <argument>clean</argument>
          </arguments>
        </configuration>
      </execution>

    </executions>
  </plugin>

但是当我执行maven-package时,它给出了以下错误:

代码语言:javascript
运行
复制
Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    /home/user/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.10.2 /usr/lib/node_modules/npm

[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.541 s
[INFO] Finished at: 2019-09-25T11:47:14+02:00
[INFO] Final Memory: 8M/40M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (npm run clean (clean)) on project

有没有人能帮帮我?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2020-02-06 16:32:51

您可以在列表中看到npm命令没有可用的clean参数。

代码语言:javascript
运行
复制
Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

[ERROR] Command execution failed.

您可以查找npm-cleanmvn clean

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58095637

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档