1

I have a package.json file where I have start and prestart scripts as follows:

"prestart": "./node_modules/react-viro/bin/run_ngrok.sh",
"start": "node node_modules/react-native/local-cli/cli.js start"

But whenever I enter the command npm start in my Git Bash terminal I get an error stating:

'.' is not recognized as an internal or external command, operable program or batch file.

amiyakt
  • 15
  • 6
  • Have a look at [this Stackoverflow thread](https://stackoverflow.com/questions/20765337/how-to-fix-is-not-an-internal-or-external-command-error), you'll find the answer right there. – SparkFountain Aug 19 '19 at 11:10
  • Ok. That worked. Sorry for taking your time. But, if I go and change the path for every imported file, then I will have problem syncing with my other friends who use ubuntu instead of windows. Do you know any solution to solve this issue ?? – amiyakt Aug 19 '19 at 13:12
  • The best solution would be to define several commands in your `package.json` file, one for each operating system. You could use the colon (`:`) as a delimiter for the OS name, like `"prestart:linux": "./node_modules/react-viro/bin/run_ngrok.sh", "prestart:windows": "node_modules/react-viro/bin/run_ngrok.sh"`. I know this feels very redundant but otherwise you would have to write a shell script yourself which then must be executed by npm... – SparkFountain Aug 19 '19 at 13:18

0 Answers0