【问题标题】:Process 'command 'npm'' finished with non-zero exit value 1进程 'command 'npm'' 以非零退出值 1 结束
【发布时间】:2015-04-20 07:12:51
【问题描述】:

我在我的本地实验室计算机中分叉并克隆了 spring.io/sagan 项目。

但是我在构建项目时遇到了一些问题,我找不到如何解决问题的答案。

我正在使用以下软件运行 Mac OS X Yosemite:

  • gradle -v 2.3
  • 节点-v 0.12.2
  • npm -v 2.7.4

  • 出了什么问题:

Execution failed for task ':sagan-client:npmBuild'. Process 'command 'npm'' finished with non-zero exit value 1 ERR! Darwin 14.3.0 npm ERR! argv "node" "/usr/local/bin/npm" "run" "build" npm ERR! node v0.12.2 npm ERR! npm v2.7.4 npm ERR! code ELIFECYCLE npm ERR! sagan@ build:gulp build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sagan@ build script 'gulp build'. npm ERR! This is most likely a problem with the sagan package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! gulp build npm ERR! You can get their info via: npm ERR! npm owner ls sagan npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /Users/youngbinjang/git/sagan/sagan-client/npm-debug.log :sagan-client:npmBuild FAILED :sagan-client:npmBuild (Thread[main,5,main]) completed. Took 1.907 secs. FAILURE: Build failed with an exception.

  • 出了什么问题: 任务 ':sagan-client:npmBuild' 执行失败。

    进程 'command 'npm'' 以非零退出值 1 结束

我应该安装 Gulp 吗?还有其他提示吗?

【问题讨论】:

标签: spring


【解决方案1】:

我的修复不一定与萨根有关,但它有效:

我有最新版本的 node 和 npm 的 linux 系统(pop OS/“Ubuntu”)。 但是当我运行gradle npm myTask 时,使用了一个过时的“默认”版本的节点。 只需在build.gradle 中定义一个兼容版本就可以了:

node {
    download = true
    version = "12.18.2"
}

(不一定是这个节点版本!)

【讨论】:

    【解决方案2】:

    正如对问题的评论中提到的,Sagan 构建当前失败,节点 v0.12 (see this open github issue)

    使用节点 v0.10 构建良好。我能够成功构建该项目。

    附带说明,节点版本管理器github link) 非常方便安装多个节点版本,并根据您的需要在不同节点版本之间轻松切换。安装 NVM 后,我做了以下操作:

    nvm install 0.10
    nvm alias default 0.10
    open a new shell & build/run Sagan
    

    (这将导致您的机器默认使用节点 v0.10。可能希望在您完成构建/运行 Sagan 后切换回来)。

    【讨论】:

      猜你喜欢
      • 2021-02-27
      • 2015-07-13
      • 1970-01-01
      • 2022-10-25
      • 1970-01-01
      • 2020-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多