Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行./star.js 时出现的问题 #24

Closed
wangkr opened this issue Jul 28, 2015 · 6 comments
Closed

运行./star.js 时出现的问题 #24

wangkr opened this issue Jul 28, 2015 · 6 comments

Comments

@wangkr
Copy link

wangkr commented Jul 28, 2015

/home/wangkr/star/star.js:11
let _ = require('lodash'),
^^^
SyntaxError: Unexpected strict mode reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

@hustcer
Copy link
Owner

hustcer commented Jul 28, 2015

你用的node版本是多少?执行的什么命令?

@hustcer
Copy link
Owner

hustcer commented Jul 28, 2015

极有可能是因为你用的node.js版本过低导致的

@wangkr
Copy link
Author

wangkr commented Jul 28, 2015

v0.12.7版的啊

@hustcer
Copy link
Owner

hustcer commented Jul 28, 2015

用这个命令试试:node --harmony ./star.js
默认情况下node 没有启用对--harmony的支持,需要手工启用下,等node 1.0发布后可能会启用

@wangkr
Copy link
Author

wangkr commented Jul 28, 2015

解决了。

@hustcer
Copy link
Owner

hustcer commented Jul 28, 2015

嗯,好的

@hustcer hustcer closed this as completed Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants