Error when executing YARN-related commands in Windows PowerShell

在 Windows PowerShell 中执行 yarn 相关命令时报错:不允许使用与号(&)
1. An error is reported when executing YARN-related commands in Windows PowerShell: & as shown in Figure 1
在 Windows PowerShell 中执行 yarn 相关命令时报错:不允许使用与号(&)
Figure 1


PS E:wwwrootwith-blade> yarn hotishop theme build & hotishop app build --all
所在位置 行:1 字符: 27
+ yarn hotishop theme build & hotishop app build --all
+                           ~
不允许使用与号(&)。& 运算符是为将来使用而保留的;请用双引号将与号引起来("&"),以将其作为字符串的一部分传递。
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : AmpersandNotAllowed



2. Decide to replace & with “&”, and then execute: after the yarn hothop theme build is successful, an error is reported:hothopNot an internal or external command, nor is it a runnable program or batch file.


PS E:wwwrootwith-blade> yarn hotishop theme build "&" hotishop app build --all
...
@theme/brooklyn: √ Mix: Compiled successfully in 2.73m
@theme/brooklyn: webpack compiled successfully
lerna success run Ran npm script 'prod' in 1 package in 180.7s:
lerna success - @theme/brooklyn
Done in 288.18s.
'hotishop' 不是内部或外部命令,也不是可运行的程序
或批处理文件。


3. Add yarn before the second hothop, and the last two builds run successfully. as shown in Figure 2
在第 2 个 hotishop 之前添加 yarn ,最后两个 build 皆成功运行
Figure 2


PS E:wwwrootwith-blade> yarn hotishop theme build "&" yarn hotishop app build --all
yarn run v1.22.15
$ E:wwwrootwith-bladenode_modules.binhotishop theme build
~ Removing apps from "./themes/brooklyn/apps/internal" ...
$ E:wwwrootwith-bladenode_modules.binlerna run --scope @theme/brooklyn prod
lerna notice cli v6.6.2
...
@theme/brooklyn: √ Mix: Compiled successfully in 2.80m
@theme/brooklyn: webpack compiled successfully
lerna success run Ran npm script 'prod' in 1 package in 216.7s:
lerna success - @theme/brooklyn
Done in 253.16s.
yarn run v1.22.15
$ E:wwwrootwith-bladenode_modules.binhotishop app build --all
$ E:wwwrootwith-bladenode_modules.binlerna run --scope @extension/* prod
lerna notice cli v6.6.2
lerna info versioning independent
lerna notice filter including "@extension/*"
lerna info filter [ '@extension/*' ]
lerna info Executing command in 28 packages: "yarn run prod"
@extension/back-top: $ mix --production
...
lerna success - @extension/visitors-counter
√ Done!
Done in 770.26s.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.