简体   繁体   English

SyntaxError:在严格模式下使用const(尝试运行Ionic应用)

[英]SyntaxError: Use of const in strict mode (trying to run Ionic app)

I'm trying to run my app using Ionic, but when I type the following: 我正在尝试使用Ionic运行我的应用程序,但是当我键入以下内容时:

ionic build android

I get the following output: 我得到以下输出:

在此处输入图片说明

Any ideas how do I proceed? 有什么想法我该如何进行?

This has nothing to do with ionic. 这与离子无关。

You need to update to the latest version of node.js and that should take care of the error. 您需要更新到最新版本的node.js,并应解决该错误。 See this similar issue on the joi node module. 请参见joi节点模块上的类似问题

I was able to fix it using: 我能够使用以下方法修复它:

1) Clear NPM's cache: 1)清除NPM的缓存:

sudo npm cache clean -f

2) Install a little helper called 'n' 2)安装一个名为“ n”的小助手

sudo npm install -g n

3) Install latest stable NodeJS version 3)安装最新的稳定NodeJS版本

sudo n stable

Update nodejs instructions taken from, SyntaxError: Use of const in strict mode 更新从SyntaxError中获取的nodejs指令:在严格模式下使用const

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

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