我必须从 VS Code 终端执行以下命令。我在 Windows 10 机器上运行我的应用程序。
set DEBUG=app & node app.js
Run Code Online (Sandbox Code Playgroud)
当我运行上述命令时,终端给了我以下错误消息。
At line:1 char:15
+ set DEBUG=app & node app.js
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for
future use; wrap an ampersand in double quotation marks
("&") to pass it as part of a string.
+ CategoryInfo : ParserError: (:) [],
ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmpersandNotAllowed
Run Code Online (Sandbox Code Playgroud)
但是,当我分别从命令窗口运行相同的命令时,它会按预期正常执行。