如何解决gitlab 运行程序 npm 安装错误“npm ERR!prepareGitDep”
image: jangrewe/gitlab-ci-android
variables:
ANDROID_COMPILE_SDK: "29"
ANDROID_BUILD_TOOLS: "29.0.3"
ANDROID_SDK_TOOLS: "6858069"
before_script:
- sudo yum remove -y nodejs
- sudo yum install -y gcc-c++ make
- curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
- sudo yum install -y nodejs
- node -v
- npm -v
- npm cache clean --force
- npm install
- npx jetify
# - react-native link #Link the resources
- chmod +x android/gradlew #Provide permission for execution
stages:
- build
build:
stage: build
tags:
- AndroidBuild
script:
- ./gradlew assembleProdRelease
artifacts:
paths:
- android/app/build/output/all/
上面是我用来构建 RN android 的 gitlab-ci.yml,我在 npm install
上遇到了以下 npm 错误
$ npm install
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information,see https://github.com/axios/axios/pull/3410
npm WARN deprecated @react-native-community/async-storage@1.11.0: Async Storage has moved to new organization: https://github.com/react-native-async-storage/async-storage
npm WARN deprecated react-native-dotenv@0.2.0: critical bugs fixed in v2.2.0
npm WARN deprecated react-navigation-stack@1.10.3: This version of React Navigation Stack is no longer supported. Please upgrade to 2.x.x. See https://reactnavigation.org/docs/4.x/upgrading-from-3.x#react-navigation-stack for instructions.
npm WARN deprecated deep-assign@3.0.0: Check out `lodash.merge` or `merge-options` instead.
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please,upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please,upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package,see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! prepareGitDep 1>
npm ERR! prepareGitDep > appium-windows-driver@1.8.0 install /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/appium-windows-driver
npm ERR! prepareGitDep > node install-npm.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > core-js@2.6.11 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/@babel/polyfill/node_modules/core-js
npm ERR! prepareGitDep > node -e "try{require('./postinstall')}catch(e){}"
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > core-js@2.6.11 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/appium-tizen-driver/node_modules/core-js
npm ERR! prepareGitDep > node -e "try{require('./postinstall')}catch(e){}"
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > core-js@2.6.11 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/babel-runtime/node_modules/core-js
npm ERR! prepareGitDep > node -e "try{require('./postinstall')}catch(e){}"
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > core-js@3.6.4 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/core-js
npm ERR! prepareGitDep > node -e "try{require('./postinstall')}catch(e){}"
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > appium-chromedriver@4.21.0 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/appium-chromedriver
npm ERR! prepareGitDep > node install-npm.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep [12:31:12] [Chromedriver Install] Installing Chromedriver version '80.0.3987.106' for platform 'linux' and architecture '64'
npm ERR! prepareGitDep [12:31:12] [Chromedriver Install] Opening temp file to write 'chromedriver_linux64' to...
npm ERR! prepareGitDep [12:31:12] [Chromedriver Install] Opened temp file '/tmp/2021116-109537-1ggtq6c.267m/chromedriver_linux64.zip'
npm ERR! prepareGitDep [12:31:12] [Chromedriver Install] Downloading https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip...
npm ERR! prepareGitDep [12:31:13] [Chromedriver Install] Writing binary content to /tmp/2021116-109537-1ggtq6c.267m/chromedriver_linux64.zip...
npm ERR! prepareGitDep [12:31:13] [Chromedriver Install] Extracting /tmp/2021116-109537-1ggtq6c.267m/chromedriver_linux64.zip to /tmp/2021116-109537-1ggtq6c.267m/chromedriver_linux64
npm ERR! prepareGitDep [12:31:13] [Chromedriver Install] Creating /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux...
npm ERR! prepareGitDep [12:31:13] [Chromedriver Install] Copying unzipped binary,reading from /tmp/2021116-109537-1ggtq6c.267m/chromedriver_linux64/chromedriver...
npm ERR! prepareGitDep [12:31:13] [Chromedriver Install] Writing to /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64...
npm ERR! prepareGitDep [12:31:13] [Chromedriver Install] /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 successfully put in place
npm ERR! prepareGitDep
npm ERR! prepareGitDep > core-js@2.6.12 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/core-js
npm ERR! prepareGitDep > node -e "try{require('./postinstall')}catch(e){}"
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > react-native-macos@0.60.0-microsoft.73 postinstall /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f/node_modules/react-native-macos
npm ERR! prepareGitDep > node scripts/postInstall.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > react-native-webview@10.3.2 prepare /home/gitlab-runner/.npm/_cacache/tmp/git-clone-c8ee661f
npm ERR! prepareGitDep > yarn build
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep 2> npm WARN install Usage of the `--dev` option is deprecated. Use `--also=dev` instead.
npm ERR! prepareGitDep npm WARN deprecated babel-eslint@10.0.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm ERR! prepareGitDep npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm ERR! prepareGitDep npm WARN deprecated @types/jest-diff@24.3.0: This is a stub types definition. jest-diff provides its own type definitions,so you do not need this installed.
npm ERR! prepareGitDep npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
npm ERR! prepareGitDep npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package,see https://github.com/request/request/issues/3142
npm ERR! prepareGitDep npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm ERR! prepareGitDep npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm ERR! prepareGitDep npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm ERR! prepareGitDep npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm ERR! prepareGitDep npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! prepareGitDep npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please,upgrade your dependencies to the actual version of core-js@3.
npm ERR! prepareGitDep npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information,see https://github.com/axios/axios/pull/3410
npm ERR! prepareGitDep npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! prepareGitDep npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only,flatted is its successor.
npm ERR! prepareGitDep npm WARN deprecated @babel/polyfill@7.12.1: ? This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm ERR! prepareGitDep npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! prepareGitDep npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! prepareGitDep npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! prepareGitDep npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package,see https://github.com/request/request/issues/3142
npm ERR! prepareGitDep npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm ERR! prepareGitDep npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! prepareGitDep Not installing WinAppDriver since did not detect a Windows system
npm ERR! prepareGitDep sh: yarn: command not found
npm ERR! prepareGitDep npm ERR! code ELIFECYCLE
npm ERR! prepareGitDep npm ERR! syscall spawn
npm ERR! prepareGitDep npm ERR! file sh
npm ERR! prepareGitDep npm ERR! errno ENOENT
npm ERR! prepareGitDep npm ERR! react-native-webview@10.3.2 prepare: `yarn build`
npm ERR! prepareGitDep npm ERR! spawn ENOENT
npm ERR! prepareGitDep npm ERR!
npm ERR! prepareGitDep npm ERR! Failed at the react-native-webview@10.3.2 prepare script.
npm ERR! prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! prepareGitDep
npm ERR! prepareGitDep npm ERR! A complete log of this run can be found in:
npm ERR! prepareGitDep npm ERR! /home/gitlab-runner/.npm/_logs/2021-02-16T04_31_14_357Z-debug.log
npm ERR! prepareGitDep
npm ERR! premature close
npm ERR! A complete log of this run can be found in:
npm ERR! /home/gitlab-runner/.npm/_logs/2021-02-16T04_31_14_497Z-debug.log
Cleaning up file based variables
ERROR: Job failed: exit status 1
当我尝试 git pull 到另一个 centos 服务器时,npm install 工作正常。有什么帮助吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。