TT Bigdata TT Bigdata
首页
GitHub (opens new window)
JaneTTR

JaneTTR

数据酿造智慧,每一滴都是沉淀!
  • 报错解决

    • Ambari 报错
    • Bigtop 报错
      • Hadoop

      • Spark

      • Trino

      • Hudi

      • Paimon

      • Livy

      • Flink

        • .git can't be found during `prepare`
          • 报错日志详解
          • 报错截图参考
          • 解决方案:跳过脚本执行
            • 添加 --ignore-scripts 参数
        • Angular CLI requires Node >=14.15
        • npm run ci-check 报错退出码 3
        • TypeScript 类型声明错误
      • Atlas

      • Superset

      • Jsvc

      • Zookeeper

      • Hive

      • Sqoop

      • Cloudbeaver

      • Bigtop-select

      • Knox

      • Hue

  • 系统适配

  • 监控与调优

  • BUG临时处理
  • 实验室

  • 运维资料
  • 报错解决
  • Bigtop 报错
  • Flink
JaneTTR
2022-12-18
目录
报错日志详解
报错截图参考
解决方案:跳过脚本执行
添加 --ignore-scripts 参数

.git can't be found during prepare

在 Bigtop 编译 Flink Dashboard 模块时,执行 npm install 过程中触发了 husky install 脚本,但由于构建目录并不包含 .git ,导致报错退出。

# 报错日志详解

日志如下:


npm info lifecycle [email protected]~prepublish: [email protected]
npm info lifecycle [email protected]~prepare: [email protected]
npm WARN lifecycle The node binary used for scripts is /root/.nvm/versions/node/v12.13.0/bin/node but npm is using /opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-w
eb/web-dashboard/node/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] prepare /opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard
> cd ../.. && husky install flink-runtime-web/web-dashboard/.husky

.git can't be found (see https://git.io/Jc3F9)
npm verb lifecycle [email protected]~prepare: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~prepare: PATH: /opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/node/node_modules/npm/node_modules/npm-lif
ecycle/node-gyp-bin:/opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/node_modules/.bin:/root/.nvm/versions/node/v12.13.0/bin:/opt/enhance_env/minic
onda2/bin:/opt/enhance_env/miniconda2/condabin:/opt/enhance_env/flex-2.6.4/bin:/usr/local/R-4.4.2/bin:/opt/modules/cmake3/bin:/opt/modules/apache-maven-3.8.4/bin:/usr
/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/modules/jdk1.8.0_202/bin:/opt/modules/gradle-5.6.4/bin:/opt/modules/apache-ant-1.10.12
/bin:/opt/modules/apache-ivy-2.5.0/bin
npm verb lifecycle [email protected]~prepare: CWD: /opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard
npm info lifecycle [email protected]~prepare: Failed to exec prepare script
npm verb stack Error: [email protected] prepare: `cd ../.. && husky install flink-runtime-web/web-dashboard/.husky`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/node/node_modules/npm/node_modules/npm-lifecycle/i
ndex.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:314:20)
npm verb stack     at ChildProcess.<anonymous> (/opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/node/node_modules/npm/node_modules/npm-lifecycle/l
ib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:314:20)
npm verb stack     at maybeClose (internal/child_process.js:1022:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
npm verb pkgid [email protected]
npm verb cwd /opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard
npm verb Linux 5.15.167.4-microsoft-standard-WSL2
npm verb argv "/opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/node/node" "/opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/nod
e/node_modules/npm/bin/npm-cli.js" "install" "--unsafe-perm" "--verbose" "--save" "--progress" "--registry=https://registry.npmmirror.com/"
npm verb node v12.22.6
npm verb npm  v6.14.5
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepare: `cd ../.. && husky install flink-runtime-web/web-dashboard/.husky`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

典型症状

husky 的 prepare 阶段试图执行 husky install,但当前目录并不是 Git 仓库,触发错误。

此外,还伴随 Node.js 路径混乱警告:

npm WARN lifecycle The node binary used for scripts is /root/.nvm/versions/node/v12.13.0/bin/node
but npm is using /opt/modules/bigtop/dl/flink-1.17.2/flink-runtime-web/web-dashboard/node/node itself.
1
2

参数 --scripts-prepend-node-path 可以指定使用 nvm 下 Node 路径,避免路径错乱。建议添加

# 报错截图参考

构建失败输出如下:

husky 报错

通过 npm install 安装依赖时直接中断:

prepare 报错信息

# 解决方案:跳过脚本执行

构建场景中我们并不需要 husky,因此建议显式跳过:

# 添加 --ignore-scripts 参数

npm install --unsafe-perm --verbose --save --progress --ignore-scripts
1

修改代码如下:

跳过 prepare 阶段


<execution>
    <id>npm install</id>
    <goals>
        <goal>npm</goal>
    </goals>
    <configuration>
        <!--<arguments>ci --cache-max=0 --no-save ${npm.proxy}</arguments> -->
        <arguments>install --unsafe-perm --verbose --save --progress --ignore-scripts</arguments>
        <npmRegistryURL>https://registry.npmmirror.com/</npmRegistryURL>
        <environmentVariables>
            <HUSKY_SKIP_INSTALL>true</HUSKY_SKIP_INSTALL>
        </environmentVariables>
    </configuration>
</execution>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#Flink#Bigtop#错误排查#Node.js
apache-incubator-disclaimer-resource-bundle 缺失
Angular CLI requires Node >=14.15

← apache-incubator-disclaimer-resource-bundle 缺失 Angular CLI requires Node >=14.15→

最近更新
01
当前版本 2026/08
08-29
02
把 Ambari Server HA 稳稳地跑起来
08-17
03
从一次启用操作追到主备就绪
08-17
更多文章>
Theme by Vdoing | Copyright © 2017-2026 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式