PanJiaChen / vue-element-admin

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
MIT License
87.86k stars 30.45k forks source link

npm ERR! code ELIFECYCLE #2349

Open ppatch opened 5 years ago

ppatch commented 5 years ago

npm run build:sit: npm ERR! code ELIFECYCLE

Steps to reproduce(问题复现步骤)

  1. npm cache clean --force
  2. rm -rf node_modules && rm package-lock.json && npm install
  3. npm run build:sit

报错

⠏ building for sit environment...npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-element-admin@3.10.0 build:sit: `cross-env NODE_ENV=production env_config=sit node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-element-admin@3.10.0 build:sit 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!     /root/.npm/_logs/2019-07-09T05_45_05_636Z-debug.log
log
0 info it worked if it ends with ok
1 verbose cli [ '/server/node/bin/node',
1 verbose cli   '/server/node/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build:sit' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'prebuild:sit', 'build:sit', 'postbuild:sit' ]
5 info lifecycle vue-element-admin@3.10.0~prebuild:sit: vue-element-admin@3.10.0
6 info lifecycle vue-element-admin@3.10.0~build:sit: vue-element-admin@3.10.0
7 verbose lifecycle vue-element-admin@3.10.0~build:sit: unsafe-perm in lifecycle true
8 verbose lifecycle vue-element-admin@3.10.0~build:sit: PATH: /server/node/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/www/sun/app/public/admin/node_modules/.bin:/server/node/bin:/usr/local/nginx/sbin:/usr/local/php/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/server/jdk1.8.0/bin:/server/maven/bin:/mongodb-3.2.5/bin:/root/bin
9 verbose lifecycle vue-element-admin@3.10.0~build:sit: CWD: /www/sun/app/public/admin
10 silly lifecycle vue-element-admin@3.10.0~build:sit: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=production env_config=sit node build/build.js' ]
11 silly lifecycle vue-element-admin@3.10.0~build:sit: Returned: code: 1  signal: null
12 info lifecycle vue-element-admin@3.10.0~build:sit: Failed to exec build:sit script
13 verbose stack Error: vue-element-admin@3.10.0 build:sit: `cross-env NODE_ENV=production env_config=sit node build/build.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/server/node/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/server/node/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid vue-element-admin@3.10.0
15 verbose cwd /www/sun/app/public/admin
16 verbose Linux 3.10.0-693.el7.x86_64
17 verbose argv "/server/node/bin/node" "/server/node/bin/npm" "run" "build:sit"
18 verbose node v10.16.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error vue-element-admin@3.10.0 build:sit: `cross-env NODE_ENV=production env_config=sit node build/build.js`
22 error Exit status 1
23 error Failed at the vue-element-admin@3.10.0 build:sit script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
package.json
{
  "name": "vue-element-admin",
  "version": "3.10.0",
  "description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features",
  "author": "Pan <panfree23@gmail.com>",
  "license": "MIT",
  "scripts": {
    "dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "build:prod": "cross-env NODE_ENV=production env_config=prod node build/build.js",
    "build:sit": "cross-env NODE_ENV=production env_config=sit node build/build.js",
    "lint": "eslint --ext .js,.vue src",
    "test": "npm run lint",
    "precommit": "lint-staged",
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
  },
  "lint-staged": {
    "src/**/*.{js,vue}": [
      "eslint --fix",
      "git add"
    ]
  },
  "keywords": [
    "vue",
    "element-ui",
    "admin",
    "management-system",
    "admin-template"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
  },
  "bugs": {
    "url": "https://github.com/PanJiaChen/vue-element-admin/issues"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "clipboard": "1.7.1",
    "codemirror": "5.39.2",
    "connect": "3.6.6",
    "driver.js": "0.8.1",
    "dropzone": "5.2.0",
    "echarts": "4.1.0",
    "element-ui": "2.4.6",
    "file-saver": "1.3.8",
    "js-cookie": "2.2.0",
    "jsonlint": "1.6.3",
    "jszip": "3.1.5",
    "mockjs": "1.0.1-beta3",
    "normalize.css": "7.0.0",
    "nprogress": "0.2.0",
    "plupload": "^2.3.6",
    "screenfull": "3.3.3",
    "showdown": "1.8.6",
    "sortablejs": "1.7.0",
    "tui-editor": "1.2.7",
    "vue": "2.5.17",
    "vue-count-to": "1.0.13",
    "vue-i18n": "7.3.2",
    "vue-router": "3.0.2",
    "vue-splitpane": "1.0.2",
    "vuedraggable": "^2.16.0",
    "vuex": "3.0.1",
    "xlsx": "^0.11.16"
  },
  "devDependencies": {
    "autoprefixer": "8.5.0",
    "babel-core": "6.26.3",
    "babel-eslint": "8.2.6",
    "babel-helper-vue-jsx-merge-props": "2.0.3",
    "babel-loader": "7.1.5",
    "babel-plugin-dynamic-import-node": "2.0.0",
    "babel-plugin-syntax-jsx": "6.18.0",
    "babel-plugin-transform-runtime": "6.23.0",
    "babel-plugin-transform-vue-jsx": "3.7.0",
    "babel-preset-env": "1.7.0",
    "babel-preset-stage-2": "6.24.1",
    "chalk": "2.4.1",
    "copy-webpack-plugin": "4.5.2",
    "cross-env": "5.2.0",
    "css-loader": "1.0.0",
    "eslint": "4.19.1",
    "eslint-friendly-formatter": "4.0.1",
    "eslint-loader": "2.0.0",
    "eslint-plugin-vue": "4.7.1",
    "file-loader": "1.1.11",
    "friendly-errors-webpack-plugin": "1.7.0",
    "hash-sum": "1.0.2",
    "html-webpack-plugin": "4.0.0-alpha",
    "husky": "0.14.3",
    "lint-staged": "7.2.2",
    "mini-css-extract-plugin": "0.4.1",
    "node-notifier": "5.2.1",
    "node-sass": "^4.7.2",
    "optimize-css-assets-webpack-plugin": "5.0.0",
    "ora": "3.0.0",
    "path-to-regexp": "2.4.0",
    "portfinder": "1.0.13",
    "postcss-import": "11.1.0",
    "postcss-loader": "2.1.6",
    "postcss-url": "7.3.2",
    "rimraf": "2.6.2",
    "sass-loader": "7.0.3",
    "script-ext-html-webpack-plugin": "2.0.1",
    "script-loader": "0.7.2",
    "semver": "5.5.0",
    "serve-static": "1.13.2",
    "shelljs": "0.8.2",
    "svg-sprite-loader": "3.8.0",
    "svgo": "^1.2.2",
    "uglifyjs-webpack-plugin": "1.2.7",
    "url-loader": "1.0.1",
    "vue-loader": "15.3.0",
    "vue-style-loader": "4.1.2",
    "vue-template-compiler": "2.5.17",
    "webpack": "4.16.5",
    "webpack-bundle-analyzer": "2.13.1",
    "webpack-cli": "3.1.0",
    "webpack-dev-server": "^3.7.2",
    "webpack-merge": "4.1.4"
  },
  "engines": {
    "node": ">= 6.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

Other relevant information(格外信息)

joelderrickclad commented 5 years ago

I added "C:\Windows\System32" path to environment variable list and restarted the machine. It worked for me.

Please refer this link