vue项目linux打包error126,VUE项目打包失败

在尝试使用npm打包Vue项目时遇到了错误,错误代码为ELIFECYCLE和UGLIFYJS,具体表现为webpack构建过程中出现 Unexpected token 错误。错误日志显示了npm运行build脚本时的详细信息,包括环境变量、路径配置等。解决此问题可能需要检查项目依赖、Node.js版本和webpack配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错信息是:

ERROR in 0_cd84ae3b709f08269cb2.js from UglifyJs

Unexpected token: name (raf) [0_cd84ae3b709f08269cb2.js:45801,4]

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! etl-web@1.0.0 build: `npm run test && cross-env NODE_ENV=production webpack --progress --hide-modules`

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the etl-web@1.0.0 build 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!     \AppData\Roaming\npm-cache\_logs\2018-12-19T09_50_23_529Z-debug.log

文件2018-12-19T09_50_23_529Z-debug.log里面是这些错误:

0 info it worked if it ends with ok

1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',

1 verbose cli   'C:\\Users\\xieyuqing3\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli   'run',

1 verbose cli   'build' ]

2 info using npm@6.5.0

3 info using node@v8.12.0

4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]

5 info lifecycle etl-web@1.0.0~prebuild: etl-web@1.0.0

6 info lifecycle etl-web@1.0.0~build: etl-web@1.0.0

7 verbose lifecycle etl-web@1.0.0~build: unsafe-perm in lifecycle true

8 verbose lifecycle etl-web@1.0.0~build: PATH: C:\Users\xieyuqing3\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\jd\source-manage\node_modules\.bin;C:\Users\xieyuqing3\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\xieyuqing3\bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;D:\Program Files\nodejs;C:\Users\xieyuqing3\AppData\Local\Microsoft\WindowsApps;D:\Users\xieyuqing3\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\xieyuqing3\AppData\Roaming\npm;D:\Users\xieyuqing3\AppData\Local\Programs\Fiddler;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl

9 verbose lifecycle etl-web@1.0.0~build: CWD: D:\jd\source-manage

10 silly lifecycle etl-web@1.0.0~build: Args: [ '/d /s /c',

10 silly lifecycle   'npm run test && cross-env NODE_ENV=production webpack --progress --hide-modules' ]

11 silly lifecycle etl-web@1.0.0~build: Returned: code: 2  signal: null

12 info lifecycle etl-web@1.0.0~build: Failed to exec build script

13 verbose stack Error: etl-web@1.0.0 build: `npm run test && cross-env NODE_ENV=production webpack --progress --hide-modules`

13 verbose stack Exit status 2

13 verbose stack     at EventEmitter.<anonymous> (C:\Users\xieyuqing3\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)

13 verbose stack     at emitTwo (events.js:126:13)

13 verbose stack     at EventEmitter.emit (events.js:214:7)

13 verbose stack     at ChildProcess.<anonymous> (C:\Users\xieyuqing3\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)

13 verbose stack     at emitTwo (events.js:126:13)

13 verbose stack     at ChildProcess.emit (events.js:214:7)

13 verbose stack     at maybeClose (internal/child_process.js:915:16)

13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

14 verbose pkgid etl-web@1.0.0

15 verbose cwd D:\jd\source-manage

16 verbose Windows_NT 10.0.17134

17 verbose argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xieyuqing3\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"

18 verbose node v8.12.0

19 verbose npm  v6.5.0

20 error code ELIFECYCLE

21 error errno 2

22 error etl-web@1.0.0 build: `npm run test && cross-env NODE_ENV=production webpack --progress --hide-modules`

22 error Exit status 2

23 error Failed at the etl-web@1.0.0 build script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

24 verbose exit [ 2, true ]

package.json:

{

"name": "etl-web",

"version": "1.0.0",

"description": "egg-cli project",

"private": true,

"dependencies": {

"@jd/jss-sdk-node": "^1.0.13",

"echarts": "^4.0.4",

"egg": "^2.0.0",

"egg-view-ejs": "^1.1.0",

"element-ui": "^2.4.0",

"formidable": "^1.1.1",

"formstream": "^1.1.0",

"jssha": "^2.3.1",

"memory-cache": "^0.2.0",

"moment": "^2.18.1",

"node-arabic-number-to-rmb": "^1.0.2",

"node-xlsx": "^0.11.0",

"pm2": "^2.10.1",

"promise-polyfill": "^6.0.2",

"vue": "^2.5.2",

"vue-server-renderer": "^2.5.2"

},

"devDependencies": {

"autod": "^2.8.0",

"autod-egg": "^1.0.0",

"axios": "^0.16.2",

"babel-core": "^6.5.1",

"babel-helper-vue-jsx-merge-props": "^2.0.3",

"babel-loader": "^7.1.2",

"babel-plugin-component": "^0.10.0",

"babel-plugin-syntax-dynamic-import": "^6.18.0",

"babel-plugin-syntax-jsx": "^6.18.0",

"babel-plugin-transform-object-rest-spread": "^6.26.0",

"babel-plugin-transform-vue-jsx": "^3.7.0",

"babel-polyfill": "^6.26.0",

"babel-preset-env": "^1.7.0",

"babel-preset-es2015": "^6.24.1",

"babel-preset-stage-3": "^6.24.1",

"clean-webpack-plugin": "^0.1.17",

"cross-env": "^5.0.2",

"css-loader": "^0.28.5",

"egg-bin": "^3.4.0",

"egg-ci": "^1.6.0",

"egg-mock": "^3.7.0",

"eslint": "^3.19.0",

"eslint-config-egg": "^4.2.0",

"extract-text-webpack-plugin": "^3.0.0",

"file-loader": "^0.11.2",

"http-server": "^0.8.5",

"mocha": "^3.5.3",

"node-sass": "^4.5.3",

"sass-loader": "^6.0.6",

"scriptjs": "^2.5.8",

"style-loader": "^0.18.2",

"uglify-js": "^3.0.27",

"url-loader": "^0.5.9",

"vue-echarts": "^3.0.9",

"vue-html5-editor": "^1.1.1",

"vue-loader": "^13.0.4",

"vue-router": "^3.0.1",

"vue-style-loader": "^3.0.1",

"vue-template-compiler": "^2.5.2",

"vuex": "^3.0.1",

"webpack": "^3.5.5",

"webpack-dev-server": "^2.7.1",

"webpack-manifest-plugin": "^1.3.1",

"webstorm-disable-index": "^1.2.0"

},

"engines": {

"node": ">=8.0.0"

},

"scripts": {

"start": "node app.js",

"debug": "egg-bin dev --port 8885",

"dev": "cross-env NODE_ENV=development webpack-dev-server --hot",

"test": "mocha --recursive",

"test-local": "egg-bin test",

"cov": "egg-bin cov",

"lint": "eslint .",

"ci": "npm run lint && npm run cov",

"autod": "autod",

"build": "npm run test && cross-env NODE_ENV=production webpack --progress --hide-modules",

"city": "node ./bin/citydata/parseCity.js"

},

"ci": {

"version": "6, 8"

},

"repository": {

"type": "git",

"url": ""

},

"author": "devil",

"license": "MIT"

}

73bccf0c0b4af35beddca4274520fb45.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值