R
R
Radiss2020-01-06 03:04:28
Node.js
Radiss, 2020-01-06 03:04:28

The build script uses the rm shell command, which is not available in windows - how can I replace it?

There is a script to build the project

{
  "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 --open --config 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 console:
spoiler

> rm -rf ../docs && webpack --config webpack.prod.js && npm run copy:static
"rm" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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 [email protected] 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 [email protected]6.13.4
3 info using [email protected].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
10 error missing script: build/code>
</spoiler>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OniVe, 2020-01-14
@OniVe

rimraf

A
antonwx, 2020-01-06
@antonwx

rd /s /q

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question