I want to write a batch script (build.sh) to install dependencies, run front end, and run back end at the same time
package.json file
"scripts": {
"dev": "nodemon server.js",
"client": "cd client && npm start",
"start": "concurrently \"npm run dev\" \"npm run client\" ",
"build": "chmod +x ./build.sh"
},
build.sh file
#!/bin/bash
npm run build
npm i aws-sdk body-parser concurrently cors dotenv express joi mongoose multer multer-s3
cd client
npm i axios bootstrap config jquery node-modules react react-bootstrap react-dom react-scripts redux redux-form redux-thunk web-vitals
cd ..
npm start
I'm not sure what I'm missing to have it run properly? Thanks in advance!
When I type $ npm build, into the command line (in the app's directory of course) I get this:
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/Users/SebastianRusso/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] /usr/local/lib/node_modules/npm
Did you mean this?
rebuild
Sebastians-MacBook-Pro:profile-app-server SebastianRusso$ npm buildd
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/Users/SebastianRusso/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] /usr/local/lib/node_modules/npm
Did you mean this?
rebuild
$ npm build, butnpm build.$is not part of the command, just a convention for representing the user's shell prompt.