【轉】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、解決辦法

     不能用關鍵字、標識符命名


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM