Error when executing YARN-related commands in Windows PowerShell
1. An error is reported when executing YARN-related commands in Windows PowerShell: & as shown in Figure 1
PS E:\wwwroot\with-blade> yarn hotshop theme build & hothop app build --all
Location Line:1 Characters: 27
+ Yarn Hothop Theme Build & Hothop App Build --all
+ ~
& is not allowed. The & operator is reserved for future use; please use double quotation marks to bring the sign ("&") to pass it as part of the string.
+ 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:\wwwroot\with-blade> yarn hotshop theme build "&" hotshop app build --all ... @Theme/Brooklyn: √ Mix: compiled successfully in 2.73M @theme/brooklyn: webpack compiled successfully Lerna Success Run Ran NPM Scriptprodin 1 package in 180.7s: Lerna Success - @theme/brooklyn Done in 288.18s. hothopNot an internal or external command, nor a runnable program or batch files.
3. Add yarn before the second hothop, and the last two builds run successfully. as shown in Figure 2
PS E:\wwwroot\with-blade> yarn hothop theme build "&" yarn hothop app build --all YARN RUN v1.22.15 $e:\wwwroot\with-blade\node_modules\.bin\hothop theme build ~ remove apps from "./themes/brooklyn/apps/internal" ... $e:\wwwroot\with-blade\node_modules\.bin\lerna 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 Scriptprodin 1 package in 216.7s: Lerna Success - @theme/brooklyn Done in 253.16s. YARN RUN v1.22.15 $e:\wwwroot\with-blade\node_modules\.bin\hothop app build --all $ e:\wwwroot\with-blade\node_modules\.bin\lerna run --scope @extension/* prod Lerna Notice CLI v6.6.2 lerna info versioning dependence 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.

