gpt4 book ai didi

node.js - Ember.js:将选项传递给node.js

转载 作者:太空宇宙 更新时间:2023-11-04 00:39:28 31 4
gpt4 key购买 nike

我正在尝试将一些 LESS 代码(通过 ember-cli-less)构建到 CSS 文件中。

1) https://almsaeedstudio.com/ AdminLTE LESS 文件2) Bootstrap LESS 文件。

我得到了:

⠸ Building
<--- Last few GCs --->
87632 ms: Scavenge 1403.1 (1458.1) -> 1403.1 (1458.1) MB, 92.0 / 0 ms (+ 19.3 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
90306 ms: Mark-sweep 1403.1 (1458.1) -> 1399.0 (1457.1) MB, 2674.4 / 0 ms (+ 1196.1 ms in 2698 steps since start of marking, biggest step 21.2 ms) [last resort gc].
93043 ms: Mark-sweep 1399.0 (1457.1) -> 1396.1 (1458.1) MB, 2737.2 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x26d2e65b4629 <JS Object>
1: eval [/home/ofry/my-new-lk/node_modules/less/lib/less/tree/ruleset.js:~33] [pc=0x2f428a9933db] (this=0x26d2e6581591 <JS Object>,context=0x289d4931c589 <JS Object>)
2: eval [/home/ofry/my-new-lk/node_modules/less/lib/less/tree/ruleset.js:~33] [pc=0x2f428a992d84] (this=0x289d4931c7a1 <JS Object>,context=0x289d4931c589 <JS Object>)
3: evalCall [/home/ofry/my-new-lk/node_modules/less...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

所以我需要在启动时以某种方式传递 --max_old_space_size=big_number

ember build

我怎样才能做到这一点?

更新:尝试使用:

lessOptions: {
paths: [
'app/styles/less',
'bower_components/bootstrap/less'
],
max_old_space_size: 8192
},

同样的错误:

⠧ Building
<--- Last few GCs --->

216135 ms: Scavenge 1401.6 (1458.1) -> 1401.6 (1458.1) MB, 78.7 / 0 ms (+ 3.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
218646 ms: Mark-sweep 1401.6 (1458.1) -> 1401.2 (1458.1) MB, 2510.4 / 0 ms (+ 4.0 ms in 2 steps since start of marking, biggest step 3.0 ms) [last resort gc].
221062 ms: Mark-sweep 1401.2 (1458.1) -> 1400.3 (1458.1) MB, 2415.8 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x62f3f2b4629 <JS Object>
1: eval [/home/ofry/my-new-lk/node_modules/less/lib/less/tree/ruleset.js:~33] [pc=0x3f6eb137cc4f] (this=0x25d46c7e8bd9 <JS Object>,context=0xe80f72a7819 <JS Object>)
2: eval [/home/ofry/my-new-lk/node_modules/less/lib/less/tree/ruleset.js:~33] [pc=0x3f6eb137ed67] (this=0xe80f72a7a31 <JS Object>,context=0xe80f72a7819 <JS Object>)
3: evalCall [/home/ofry/my-new-lk/node_modules/less/lib...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

更新#2。链接到带有示例的存储库: https://github.com/ofry/test_ember_cli_less

最佳答案

第一个问题的答案是

 node --max_old_space_size=999999 ./node_modules/.bin/ember build

从项目的根目录运行命令。在这里,我们使用 ember 脚本手动运行 Node 并传递所有需要的参数(首先是 Node 选项,脚本(ember)脚本选项)

但是对于您的存储库( ofry/test_ember_cli_less ),我遇到了另一个错误(与您的 less 代码有关)

⠙ BuildingSyntaxError: Maximum call stack size exceeded in bower_components/bootstrap/less/grid.less on line 56, column 1:
55
56 .make-grid(xs);
57

Build failed.
File: bower_components/bootstrap/less/grid.less (56)
The Broccoli Plugin: [LessCompiler] failed with:
RangeError: Maximum call stack size exceeded
at MixinCall.eval (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/tree/mixin-call.js:136:46)
at Ruleset.eval (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/tree/ruleset.js:116:32)
at module.exports (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/transform-tree.js:67:22)
at ParseTree.toCSS (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/parse-tree.js:14:25)
at /Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/render.js:31:40
at /Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/parse.js:63:17
at Object.finish [as _finish] (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/parser/parser.js:183:28)
at Object.ImportVisitor._onSequencerEmpty (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/visitors/import-visitor.js:35:14)
at ImportSequencer.tryRun (/Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/visitors/import-sequencer.js:50:14)
at /Users/vvs/repo/test_ember_cli_less/node_modules/ember-cli-less/node_modules/broccoli-less-single/node_modules/less/lib/less/visitors/import-sequencer.js:19:25

相关issue is here

并且无需将引导源复制到您的 app/styles 目录中 - 使用 Bower/npm

关于node.js - Ember.js:将选项传递给node.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37509159/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com