Для сборки проекта есть такой скрипт
{
"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"
},
В консоли:
spoiler
> rm -rf ../docs && webpack --config webpack.prod.js && npm run copy:static
"rm" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
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 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
spoiler0 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
10 error missing script: build/code>
</spoiler>