我正在尝试使用Jenkins在服务器端构建我的应用程序。运行命令时: ** sudo ./mvnw -Pprod包* 我有以下错误消息:
[INFO] --- frontend-maven-plugin:1.6:yarn (webpack build prod) @ timetrack ---
[INFO] Running 'yarn run webpack:prod' in /var/lib/jenkins/workspace/timetrack-jh
[INFO] yarn run v1.2.1
[INFO] $ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
[ERROR] warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
[ERROR] module.js:471
[ERROR] throw err;
[ERROR] ^
[ERROR]
[ERROR] Error: Cannot find module '/var/lib/jenkins/workspace/timetrack-jh/webpack/webpack.prod.js'
[ERROR] at Function.Module._resolveFilename (module.js:469:15)
[ERROR] at Function.Module._load (module.js:417:25)
[ERROR] at Module.require (module.js:497:17)
[ERROR] at require (internal/module.js:20:19)
[ERROR] at requireConfig (/var/lib/jenkins/workspace/timetrack-jh/node_modules/webpack/bin/convert-argv.js:97:18)
[ERROR] at /var/lib/jenkins/workspace/timetrack-jh/node_modules/webpack/bin/convert-argv.js:104:17
[ERROR] at Array.forEach (native)
[ERROR] at module.exports (/var/lib/jenkins/workspace/timetrack-jh/node_modules/webpack/bin/convert-argv.js:102:15)
[ERROR] at yargs.parse (/var/lib/jenkins/workspace/timetrack-jh/node_modules/webpack/bin/webpack.js:171:41)
[ERROR] at Object.Yargs.self.parse (/var/lib/jenkins/workspace/timetrack-jh/node_modules/webpack/node_modules/yargs/yargs.js:533:18)
[ERROR] error Command failed with exit code 1.
[ERROR] error Command failed with exit code 1.
[ERROR] error Command failed with exit code 1.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------*
我在Windows机器上完成了相同的构建,并且工作正常。有人可以帮助我解决Linux系统上发生的事情吗?
Linux版本:Linux版本4.10.0-37-generic(buildd @ lgw01-amd64-022)(gcc版本6.3.0 20170406(Ubuntu 6.3.0-12ubuntu2))#41-Ubuntu SMP Fri 10月6日20: 2017年8月20日
提前致谢,
-ROD
经过一番处理我解决了上面的问题,但是它仍然存在一条新的错误信息(仅在Linux上,Windows运行良好):
[INFO] Installed Yarn locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:yarn (yarn install) @ timetrack ---
[INFO] Running 'yarn install' in /home/rodrigo/test/TimeTrack
[INFO] yarn install v1.2.1
[INFO] [1/5] Validating package.json...
[INFO] [2/5] Resolving packages...
[INFO] [3/5] Fetching packages...
[INFO] info fsevents@1.1.2: The platform "linux" is incompatible with this modul e.
[INFO] info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [4/5] Linking dependencies...
[ERROR] warning "bootstrap@4.0.0-beta" has unmet peer dependency "popper.js@^1.1 1.0".
[ERROR] warning "@schematics/angular@0.0.49" has incorrect peer dependency "@ang ular-devkit/schematics@0.0.34".
[ERROR] warning "license-webpack-plugin@1.1.1" has unmet peer dependency "webpac k-sources@>=1.0.0".
[INFO] [5/5] Building fresh packages...
[INFO] Done in 40.25s.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:yarn (webpack build prod) @ timetrack ---
[INFO] Running 'yarn run webpack:prod' in /home/rodrigo/test/TimeTrack
[INFO] yarn run v1.2.1
[INFO] $ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
[ERROR] warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
[INFO]
[INFO] <--- Last few GCs --->
[INFO]
[INFO] 28 ms: Mark-sweep 1.4 (5.5) -> 1.3 (5.5) MB, 1.2 / 0.0 ms [allocati on failure] [GC in old space requested].
[INFO] 29 ms: Mark-sweep 1.3 (5.5) -> 1.3 (5.5) MB, 1.2 / 0.0 ms [allocati on failure] [GC in old space requested].
[INFO] 30 ms: Mark-sweep 1.3 (5.5) -> 1.3 (5.5) MB, 1.2 / 0.0 ms [allocati on failure] [GC in old space requested].
[INFO] 32 ms: Mark-sweep 1.3 (5.5) -> 1.3 (4.5) MB, 1.2 / 0.0 ms [last res ort gc].
[INFO] 33 ms: Mark-sweep 1.3 (4.5) -> 1.3 (4.5) MB, 1.2 / 0.0 ms [last res ort gc].
[INFO]
[INFO]
[INFO] <--- JS stacktrace --->
[INFO]
[INFO] ==== JS stack trace =========================================
[INFO]
[INFO] Security context: 0x3957b609 <JS Object>
[INFO] 1: /* anonymous */(aka /* anonymous */) [fs.js:10] [pc=0x29d1d25d] (t his=0x395081d9 <undefined>,exports=0x3d777f45 <an Object with map 0x4e409cad>,re quire=0x39585bf1 <JS Function NativeModule.require (SharedFunctionInfo 0x3958425 d)>,module=0x3d777f11 <a NativeModule with map 0x4e40e2a1>,__filename=0x3d777f31 <String[5]: fs.js>,__dirname=0x395081d9 <undefined>)
[INFO] 2: arguments adaptor frame: 4-...
[INFO]
[ERROR] FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
[ERROR] 1: node::Abort() [node]
[ERROR] 2: 0x8c80076 [node]
[ERROR] 3: v8::Utils::ReportApiFailure(char const*, char const*) [node]
[ERROR] 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
[ERROR] 5: v8::internal::Factory::NewMap(v8::internal::InstanceType, int, v8::i nternal::ElementsKind) [node]
[ERROR] 6: v8::internal::Map::RawCopy(v8::internal::Handle<v8::internal::Map>, int) [node]
[ERROR] 7: v8::internal::Map::CopyDropDescriptors(v8::internal::Handle<v8::inte rnal::Map>) [node]
[ERROR] 8: v8::internal::Map::CopyReplaceDescriptors(v8::internal::Handle<v8::i nternal::Map>, v8::internal::Handle<v8::internal::DescriptorArray>, v8::internal ::Handle<v8::internal::LayoutDescriptor>, v8::internal::TransitionFlag, v8::inte rnal::MaybeHandle<v8::internal::Name>, char const*, v8::internal::SimpleTransiti onFlag) [node]
[ERROR] 9: v8::internal::Map::CopyAddDescriptor(v8::internal::Handle<v8::intern al::Map>, v8::internal::Descriptor*, v8::internal::TransitionFlag) [node]
[ERROR] 10: v8::internal::Map::CopyWithConstant(v8::internal::Handle<v8::interna l::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::inte rnal::Object>, v8::internal::PropertyAttributes, v8::internal::TransitionFlag) [ node]
[ERROR] 11: v8::internal::Map::TransitionToDataProperty(v8::internal::Handle<v8: :internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle< v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::S toreFromKeyed) [node]
[ERROR] 12: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::in ternal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Objec t>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [nod e]
[ERROR] 13: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v 8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [node]
[ERROR] 14: v8::internal::JSObject::AddProperty(v8::internal::Handle<v8::interna l::JSObject>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8: :internal::Object>, v8::internal::PropertyAttributes) [node]
[ERROR] 15: v8::internal::Factory::NewFunction(v8::internal::Handle<v8::internal ::String>, v8::internal::Handle<v8::internal::Code>, v8::internal::Handle<v8::in ternal::Object>, v8::internal::InstanceType, int, bool, bool, bool) [node]
[ERROR] 16: v8::internal::ApiNatives::CreateApiFunction(v8::internal::Isolate*, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v 8::internal::Object>, v8::internal::ApiNatives::ApiInstanceType) [node]
[ERROR] 17: 0x8554502 [node]
[ERROR] 18: v8::internal::ApiNatives::InstantiateFunction(v8::internal::Handle<v 8::internal::FunctionTemplateInfo>) [node]
[ERROR] 19: v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>) [node]
[ERROR] 20: v8::FunctionTemplate::GetFunction() [node]
[ERROR] 21: node::InitFs(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local< v8::Context>, void*) [node]
[ERROR] 22: 0x8c858a0 [node]
[ERROR] 23: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionC allbackInfo<v8::Value> const&)) [node]
[ERROR] 24: 0x85b3630 [node]
[ERROR] 25: 0x85b3dd0 [node]
[ERROR] 26: 0x4890a0fe
[ERROR] 27: 0x29d1d25d
[ERROR] 28: 0x4890b616
[ERROR] 29: 0x489384a8
[ERROR] 30: 0x48937d7f
[ERROR] 31: 0x29d1b14f
[ERROR] 32: 0x4890b616
[ERROR] 33: 0x489384a8
[ERROR] 34: 0x48937d7f
[ERROR] 35: 0x48937411
[ERROR] 36: 0x48936335
[ERROR] 37: 0x4893153e
[ERROR] 38: 0x48920a43
[ERROR] 39: v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal:: Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v 8::internal::Handle<v8::internal::Object>*) [node]
[ERROR] 40: v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int , v8::Local<v8::Value>*) [node]
[ERROR] 41: v8::Function::Call(v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [node]
[ERROR] 42: node::LoadEnvironment(node::Environment*) [node]
[ERROR] 43: node::Start(int, char**) [node]
[ERROR] 44: main [node]
[ERROR] 45: __libc_start_main [/lib/i386-linux-gnu/libc.so.6]
[ERROR] Aborted (core dumped)
[ERROR] error Command failed with exit code 134.
[ERROR] error Command failed with exit code 1.
[ERROR] error Command failed with exit code 1.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about th is command.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:09 min
[INFO] Finished at: 2017-11-14T19:58:35+13:00
[INFO] Final Memory: 31M/74M
[INFO] ------------------------------------------------------------------------
有人有任何帮助吗?
此致
-ROD
答案 0 :(得分:2)
I again figured out the issue. When building on Linux machine and have out of heap memory on Javascript. Need to change that lines on package.json (only happened using JHipster with Angular 4):
"webpack-dev-server": "node --max_old_space_size=5120 node_modules/webpack-dev-server/bin/webpack-dev-server.js", "webpack": "node --max_old_space_size=5120 node_modules/webpack/bin/webpack.js"
I updated the --max_old_space_size from 4096 to 5120 (1GB more).
That was it folks!
Thanks anyway for the good guys that helped me,
Best regards,
-Rod