【转】TypeError: Identifier 'assert/appName' has already been declared

原文网址:https://blog.csdn.net/you23hai45/article/details/51783585

1、错误描述


> const assert=require('assert');
TypeError: Identifier 'assert' has already been declared
at repl:1:1
at REPLServer.defaultEval (repl.js:262:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:431:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:211:10)
at REPLServer.Interface._line (readline.js:550:8)
at REPLServer.Interface._ttyWrite (readline.js:827:14)
>

2、错误原因
     由错误提示可知assert标识符已经声明了

3、解决办法

     不能用关键字、标识符命名

posted on 2019-12-26 16:02  wi100sh  阅读(768)  评论(0编辑  收藏  举报

导航