increase-memory-limit
increase-memory-limit copied to clipboard
SyntaxError: Unexpected identifier
vue-cli项目 平台:mac node:10.14.2
"scripts": {
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
"serve": "vue-cli-service serve",
}
$ npm run serve
> [email protected] serve /Users/hfd/Documents/ms/gitlab/sc/fsweb/dev/
> vue-cli-service serve
/Users/hfd/Documents/ms/gitlab/sc/fsweb/dev/node_modules/@vue/cli-service/bin/vue-cli-service.js:5
const requiredVersion = require('../package.json').engines.node --max-old-space-size=4096
^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:83:7)
at createScript (vm.js:267:10)
at Object.runInThisContext (vm.js:319:10)
at Module._compile (internal/modules/cjs/loader.js:686:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:776:12)
at executeUserCode (internal/bootstrap/node.js:342:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve 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! /Users/hfd/.npm/_logs/2018-12-26T01_39_05_364Z-debug.log
最后找到这个文件删除掉了 --max-old-space-size=4096
找到increase-memory-limit下的index.js ,更改if (line.startsWith("if [") || line.startsWith("@IF"))
为
if (line.startsWith("if [") || line.startsWith("@IF") || line.startsWith('const requiredVersion ='))
最后找到这个文件删除掉了
--max-old-space-size=4096
亲测ok thanks
找到increase-memory-limit下的index.js ,更改
if (line.startsWith("if [") || line.startsWith("@IF"))
为if (line.startsWith("if [") || line.startsWith("@IF") || line.startsWith('const requiredVersion ='))
macos 10.14没用
I have the same problem
rm -rf node_modules npm i