In the build script, use the shell rm command, which in windows is not - than to replace?

To build the project there is a script
{
 "name": "mern-client",
 "version": "1.0.1",
 "description": "Simple starter package for Redux with React and Babel support",
 "main": "index.js",
 "scripts": {
 "dev": "npm ls react && webpack-dev-server --config --open webpack.dev.js",
 "start": "serve ../docs"
 "build": "rm-rf ../docs && webpack --config webpack.prod.js && npm run copy:static",
 "copy:static": "cp -rf ./src/statics ../docs"
 },


In the console:
spoiler

> rm-rf ../docs && webpack --config webpack.prod.js && npm run copy:static

"rm" is not internal or external
command, operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mern-client@1.0.1 build: `rm-rf ../docs && webpack --config webpack.prod.js && npm run copy:static`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mern-client@1.0.1 a build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-01-05T23_35_28_093Z-debug.log

D:\ASITES\mern-master\client>cd ..

D:\ASITES\mern-master>echo "JWT_SECRET=YOUR_JWT_SECRET" >> ./server/src/.env

D:\ASITES\mern-master>npm run build
npm ERR! missing script: build

debag.log
spoiler

0 info it worked if it ends with ok
1 verbose cli [ 'D:\\programms\\NODEjs\\node.exe',
1 verbose cli 'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm@6.13.4
3 info using node@v10.16.2
4 verbose stack Error: missing script: build
4 verbose stack at run (C:\Users\user\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:63:5
4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:116:5
4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:436:5
4 verbose stack at checkBinReferences_ (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:391:45)
4 verbose stack at final (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:434:3)
4 verbose stack at then (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:161:5)
4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:281:12
4 verbose stack at C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:115:16
4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
5 verbose cwd D:\ASITES\mern-master
6 verbose Windows_NT 10.0.17134
7 verbose argv "D:\\programms\\NODEjs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
8 verbose node v10.16.2
9 verbose npm v6.13.4
Script error 10 missing: build/property>
</spoiler>
April 4th 20 at 00:54
3 answers
April 4th 20 at 00:56
del
April 4th 20 at 00:58
rd /s /q
@Orville_Armstron not working
"build": "rd /s /q ../docs && webpack --config webpack.prod.js && npm run copy:static",
 "copy:static": "cp -rf ./src/statics ../docs"

Invalid key: "docs".

well, "cp -rf also what must be replaced - Anahi.Littel50 commented on April 4th 20 at 01:01
@Anahi.Littel50, well, change the slashes. Well it's Windows.

To copy is xcopy - maurine.Buckridge commented on April 4th 20 at 01:04
@maurine.Buckridge, it's not the slashes, so, too, does not work

"build": "del -rf ..\docs && webpack --config webpack.prod.js && npm run copy:static",
 "copy:static": "cp -rf .\src\statics ..\docs"


In the console:
npm ERR! code EJSONPARSE
npm ERR! file D:\ASITES\mern-master\client\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token d in JSON at position 303 while parsing near '...build": "del -rf ..\docs && webpack --co...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript. - Anahi.Littel50 commented on April 4th 20 at 01:07
@Anahi.Littel50, of course, and with JSON, you also do not know how to work.

And what the hell -rf at the del?! - maurine.Buckridge commented on April 4th 20 at 01:10
@maurine.Buckridge, well if I could understand the question, I would not have asked.

Already tried different combinations:
and with "rd /s /q ..\docs" , "rd \s \q ..\docs" - this is not working. - Anahi.Littel50 commented on April 4th 20 at 01:13
Well, damn, backslashes in the json (like almost everywhere else) need to be escaped. Well this is the basics of programming. - maurine.Buckridge commented on April 4th 20 at 01:16
@maurine.Buckridge,

it doesn't work
"build": "rd /s /q ..\/docs && webpack --config webpack.prod.js && npm run copy:static",
 "copy:static": "cp -rf ./src/statics ..\/docs"


even so
"build": "rd \/s \/q ..\/docs && webpack --config webpack.prod.js && npm run copy:static",
 "copy:static": "cp -rf .\/src/statics ..\/docs"
- Anahi.Littel50 commented on April 4th 20 at 01:19
April 4th 20 at 01:00

Find more questions by tags Node.jsnpmReact