简体   繁体   English

Ember安装问题:SyntaxError:在严格模式下使用const

[英]Ember Installation Issue: SyntaxError: Use of const in strict mode

When trying to install Ember.js on Windows (and possibly other systems), after running the following commands: 尝试在Windows(以及可能的其他系统)上安装Ember.js时,请运行以下命令:

npm install -g npm
npm install -g ember-cli
npm install -g bower

No errors are raised, how the command ember -v outputs the following: 没有错误发生,命令ember -v如何输出以下内容:

C:\Users\<user>\AppData\Roaming\npm\node_modules\ember-cli\lib\cli\index.js:3
const willInterruptProcess = require('../utilities/will-interrupt-process');
^^^^^
SyntaxError: Use of const in strict mode.
    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 Module.require (module.js:365:17)
    at require (module.js:384:17)
    at C:\Users\Shayn\AppData\Roaming\npm\node_modules\ember-cli\bin\ember:26:11
    at C:\Users\Shayn\AppData\Roaming\npm\node_modules\ember-cli\node_modules\resolve\lib\async.js:50:13
    at processDirs (C:\Users\Shayn\AppData\Roaming\npm\node_modules\ember-cli\node_modules\resolve\lib\async.js:182:39)

This suggests an issue with my Ember installation, how can I address this? 这表明我的Ember安装存在问题,如何解决?

The solution is suggested in a few other answers, for example this one , however this exact solution will not work on Windows. 其他一些答案(例如this )中提出了该解决方案,但是这种确切的解决方案在Windows上不起作用。

Instead, the best solution is to get the latest version of Node installed via an installer. 相反,最好的解决方案是通过安装程序获取最新版本的Node

To verify after installation try the following: 要在安装后进行验证,请尝试以下操作:

node --version

Which should output something like: 哪个应该输出类似:

v8.9.1

Previously this command would have given a lower version number. 以前,此命令将给出较低的版本号。 In my case it was similar to v0.12 . 就我而言,它类似于v0.12

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM