Jenkins构建失败-错误:未找到:make

时间:2019-03-19 21:41:05

标签: node.js jenkins npm jenkins-pipeline npm-install

我尝试为我的npm模块创建CI,但是我遇到了NPM install命令的问题。我尝试在全球范围内安装gyp,但对我而言无效。依赖关系是否存在问题(控制台输出后添加package.json文件),或者缺少jenkins的某些配置? 节点版本为11.6.0

控制台输出:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:id="@+id/linearLayout_main"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    tools:context=".MainActivity">

    <!--custome toolbar-->
    <include layout="@layout/tool_bar" />

    <!--Wifi name and state-->
    <LinearLayout
        android:id="@+id/linear_wifi_name"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/wifi_icon_id"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.15"
            android:src="@drawable/ic_wifi_white_36dp"/>

        <TextView
            android:id="@+id/wifi_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.50"
            android:textSize="18sp"
            android:gravity="left"
            android:layout_gravity="center"
            android:text="SOHOWIFI" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.20"
            android:textSize="16sp"
            android:layout_gravity="center"
            android:gravity="right"
            android:text="Scan"/>

        <ImageView
            android:id="@+id/scan_icon"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.10"
            android:src="@drawable/ic_keyboard_arrow_right_white_36dp"/>

    </LinearLayout>

    <!--Progess bar-->
    <ProgressBar
        style="@android:style/Widget.DeviceDefault.Light.ProgressBar.Horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="visible"
        android:id="@+id/progress_bar" />



    <TextView
        android:id="@+id/result_local"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:typeface="monospace"
        android:text="Local Network:"
        android:paddingLeft="5dp"
        android:textColor="@color/colorAccent"
        android:textSize="18sp"/>

    <!-- output of list local ip and public ip-->

    <ListView
        android:id="@+id/local_network"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/scan_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end|right"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_next_button"
        android:background="@color/colorPrimary"
        />
</LinearLayout>

Package.json

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:160:21)
gyp ERR! System Linux 4.9.0-8-amd64
gyp ERR! command "/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/bin/node" "/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/jenkins_home/workspace/defined-id/defined-id/node_modules/bufferutil
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN defined-id@1.0.0 No description
npm WARN The package js-sha256 is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bufferutil@3.0.5 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bufferutil@3.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/jenkins_home/.npm/_logs/2019-03-19T08_59_17_472Z-debug.log
Build step 'Execute shell' marked build as failure
Finished: FAILURE

执行外壳程序:

{
    "name": "defined-id",
    "version": "1.0.0",
    "description": "",
    "main": "lib/index.js",
    "types": "lib/index.d.ts",
    "scripts": {
        "test": "jest --config jestconfig.json",
        "build": "tsc",
        "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
        "lint": "tslint -p tsconfig.json",
        "prepare": "yarn run build",
        "prepublishOnly": "yarn test && yarn run lint",
        "preversion": "yarn run lint",
        "version": "yarn run format && git add -A src",
        "postversion": "git push && git push --tags"
    },
    "repository": {
        "type": "git"
    },
    "author": "Geens NPO",
    "license": "ISC",
    "devDependencies": {
        "@types/jest": "^23.3.9",
        "jest": "^23.6.0",
        "js-sha256": "^0.9.0",
        "prettier": "^1.15.2",
        "ts-jest": "^23.10.5",
        "ts-node": "^8.0.3",
        "tslint": "^5.11.0",
        "tslint-config-prettier": "^1.16.0",
        "typescript": "^3.1.6"
    },
    "dependencies": {
        "@types/node": "^10.12.18",
        "@types/uuid": "^3.4.4",
        "base-58": "0.0.1",
        "base58check": "^2.0.0",
        "create-hmac": "^1.1.7",
        "js-sha256": "^0.9.0",
        "jsonld": "^1.4.0",
        "key-encoder": "^1.1.7",
        "nem2-sdk": "0.10.2",
        "ripemd160": "^2.0.2",
        "tweetnacl": "^1.0.1",
        "tweetnacl-util": "^0.15.0"
    }
}

1 个答案:

答案 0 :(得分:0)

我怀疑这不是詹金斯错误。

在执行NPM命令的Linux中执行以下行:

sudo apt-get install build-essential

然后重新建立您的詹金斯工作。