Linux react npm run build 报错

发布于 2022-09-13 00:28:34 字数 5983 浏览 20 评论 0

我的项目在window mac 运行和打包都没有问题,现在想在Linux做一个自动打包程序,就一直报错,关键我还找不到问题点,请各位大神路过给些思路,谢谢了

报错log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/node-v14.17.2-linux-x64/bin/node',
1 verbose cli '/home/node-v14.17.2-linux-x64/bin/npm',
1 verbose cli 'run',
1 verbose cli 'yx-dev'
1 verbose cli ]
2 info using npm@6.14.13
3 info using node@v14.17.2
4 verbose run-script [ 'preyx-dev', 'yx-dev', 'postyx-dev' ]
5 info lifecycle webpack-research@1.0.0~preyx-dev: webpack-research@1.0.0
6 info lifecycle webpack-research@1.0.0~yx-dev: webpack-research@1.0.0
7 verbose lifecycle webpack-research@1.0.0~yx-dev: unsafe-perm in lifecycle true
8 verbose lifecycle webpack-research@1.0.0~yx-dev: PATH: /home/node-v14.17.2-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/yx-index-lib-pc-web/node_modules/.bin:/home/node-v14.17.2-linux-x64/bin:/home/apache-maven-3.8.1/bin:/usr/local/java/jdk1.8.0_60/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
9 verbose lifecycle webpack-research@1.0.0~yx-dev: CWD: /home/yx-index-lib-pc-web
10 silly lifecycle webpack-research@1.0.0~yx-dev: Args: [ '-c', 'npm run clean && npm run build-dll && npm run build ' ]
11 silly lifecycle webpack-research@1.0.0~yx-dev: Returned: code: 1 signal: null
12 info lifecycle webpack-research@1.0.0~yx-dev: Failed to exec yx-dev script
13 verbose stack Error: webpack-research@1.0.0 yx-dev: npm run clean && npm run build-dll && npm run build
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/home/node-v14.17.2-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:375:28)
13 verbose stack at ChildProcess.<anonymous> (/home/node-v14.17.2-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:375:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid webpack-research@1.0.0
15 verbose cwd /home/yx-index-lib-pc-web
16 verbose Linux 3.10.0-1160.11.1.el7.x86_64
17 verbose argv "/home/node-v14.17.2-linux-x64/bin/node" "/home/node-v14.17.2-linux-x64/bin/npm" "run" "yx-dev"
18 verbose node v14.17.2
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 1
22 error webpack-research@1.0.0 yx-dev: npm run clean && npm run build-dll && npm run build
22 error Exit status 1
23 error Failed at the webpack-research@1.0.0 yx-dev 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": "webpack-research",
"sideEffects": false,
"version": "1.0.0",
"description": "",
"scripts": {

"test": "echo \"Error: no test specified\" && exit 1",
"build-dll": "webpack -p --progress --config ./config/webpack.dll.conf.js",
"build": "cross-env NODE_ENV=production webpack --mode production --config ./config/webpack.prod.js",
"yunxi-dev": "npm run clean && npm run build-dll && npm run build ",
"start": "http-server ./dist --port 9100",
"clean": "rimraf ./dist & rimraf ./dist.zip",
"watch": "webpack --watch --config ./config/webpack.prod.js",
"dev": "cross-env NODE_ENV=development webpack-dev-server --config ./config/webpack.dev.js",
"mock": "nodemon ./mock/index.js"

},
"author": "",
"license": "ISC",
"dependencies": {

"@ant-design/icons": "^4.6.2",
"@babel/plugin-proposal-decorators": "^7.14.5",
"antd": "^4.15.0",
"axios": "^0.21.1",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^4.0.0-alpha.0",
"clipboard-react": "^1.0.0",
"compression-webpack-plugin": "5.0.0",
"cross-env": "^7.0.3",
"css-loader": "^3.6.0",
"echarts": "^5.0.2",
"echarts-for-react": "^3.0.1",
"file-loader": "^6.2.0",
"happypack": "^5.0.1",
"html-webpack-plugin": "^4.2.2",
"less": "^4.1.1",
"less-loader": "5.0.0",
"less-vars-to-js": "^1.3.0",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "0.5.0",
"mobx": "^6.1.7",
"mobx-react": "^7.1.0",
"mockjs": "^1.1.0",
"monaco-editor-webpack-plugin": "^4.0.0",
"optimize-css-assets-webpack-plugin": "^6.0.1",
"progress-bar-webpack-plugin": "^2.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-highlight-words": "0.9.0",
"react-monaco-editor": "^0.43.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-simple-verify": "^1.0.9",
"style-loader": "^2.0.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"url-loader": "^4.1.1",
"webpack": "~4.36.0",
"webpack-cli": "~3.3.12",
"webpack-dev-server": "~3.11.2",
"webpack-merge": "~5.7.3",
"webpack-parallel-uglify-plugin": "^2.0.0",
"@babel/core": "^7.13.14",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.13.13",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"awesome-typescript-loader": "^5.2.1",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "^7.23.2",
"express-mock-server": "^3.2.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"http-server": "^0.12.3",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"loadable-components": "^2.2.3",
"mobx-react-devtools": "^6.1.1",
"node-xlsx": "^0.16.1",
"prettier": "2.2.1",
"rimraf": "^3.0.2",
"ts-import-plugin": "^1.6.7",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.2.4"

},
"devDependencies": {},

"lint-staged": {

"*.{js,md,scss,.css}": [
  "prettier --write"
],
"*.{js,jsx}": "eslint --cache --fix"

}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文