In order to initialize the local mongoDB server, I have to run the following command from the root directory in the terminal :
/'Program Files'/MongoDB/Server/4.4/bin/mongod.exe --dbpath=/MongoDB_Data
Now, I wish to insert a script in package.json:
"start_server" = "/'Program Files'/MongoDB/Server/4.4/bin/mongod.exe --dbpath=/MongoDB_Data"
so that I only need to run npm run create_server to execute the command.
But it throws this error:
'/'Program' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] create_server: `/'Program Files'/MongoDB/Server/4.4/bin/mongod.exe --dbpath=/MongoDB_Data`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] create_server 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\ASUS\AppData\Roaming\npm-cache\_logs\2021-01-31T13_36_01_276Z-debug.log
Can someone please tell me how to fix this? I'm still a beginner.