question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Unexpected identifier

See original GitHub issue

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

> scfsweb@1.0.0 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! scfsweb@1.0.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scfsweb@1.0.0 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

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
luren9commented, Dec 26, 2018

最后找到这个文件删除掉了 --max-old-space-size=4096

0reactions
zrp1025commented, Apr 25, 2022

rm -rf node_modules npm i

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected identifier in JavaScript [Solved]
To solve the "Uncaught SyntaxError: Unexpected identifier" error, make sure you don't have any misspelled keywords, e.g. Let or Function instead of let...
Read more >
Unexpected Identifier in Chrome's Javascript console
I got SyntaxError: Unexpected identifier error, for invalid order between async and static, static must come first.
Read more >
How To Solve The Unexpected Identifier Error in JavaScript
How do you fix this Unexpected identifier error in your code? The simplest thing you can do to find a specific error like...
Read more >
A Common Cause of "Uncaught syntax error - Techstacker
A Common Cause of "Uncaught syntax error: unexpected identifier" in JavaScript ... One of the most common reasons is that you're trying to...
Read more >
How to Fix "Uncaught SyntaxError: Unexpected identifier" in ...
In most cases, it is just code that is not adhering to the JavaScript syntax rules or contains typos. Hopefully, this post has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found