zoukankan      html  css  js  c++  java
  • FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed

    • vue项目 npm run dev 报错

    WAIT Compiling...16:36:21

    95% emittingFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
    1: node_module_register
    2: v8::internal::Factory::NewRawTwoByteString
    npm ERR! code ELIFECYCLE
    npm ERR! errno 3
    npm ERR! easyviews@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
    npm ERR! Exit status 3
    npm ERR!
    npm ERR! Failed at the easyviews@1.0.0 dev 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! F:Program Files odejs ode_cache\_logs2019-04-03T08_36_25_025Z-debug.log

    • webpack编译报错提示内存溢出:
    这个报错的意思就是Node内存不足所导致的。我们都知道 Node 是基于V8引擎,在一般的后端开发语言中,在基本的内存使用上没有什么限制。
    但是,在 Node 中通过 JavaScript 使用内存时只能使用部分内存(64位系统下约为1.4 GB,32位系统下约为0.7 GB)所以不管你电脑实际内存多大,在node运行JavaScript打包编译的时候所使用的内存大小,并不会因为你系统的实际内存大小改变而改变。
    • window系统下解决办法:

    在 ode_modules.binwebpack-dev-server.cmd文件中添加 "--max_old_space_size=2048"  //2048的单位为M,表示node最大占用内存数值,可以根据实际情况自行调整数值

    • 参考链接

    https://juejin.im/post/5c5152ad6fb9a049ea395bea

  • 相关阅读:
    POJ 1315 Don't Get Rooked
    POJ 2051 Argus
    POJ 1942 Paths on a Grid
    POJ 2151 Check the difficulty of problems
    POJ 3349 Snowflake Snow Snowflakes
    POJ 1753 Flip Game
    POJ 2392 Space Elevator
    POJ 2385 Apple Catching
    POJ 2356 Find a multiple
    POJ 2355 Railway tickets
  • 原文地址:https://www.cnblogs.com/cxying93/p/10677360.html
Copyright © 2011-2022 走看看