1
  "scripts": {
    "start-js": "react-scripts start",
    "start": "npm-run-all -p watch-css start-js",
    "build": "npm run build-css && react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "build-css": "node-sass-chokidar src/ -o src/",
    "watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --
watch --recursive",
    "now-start": "node server/server.js",
    "deploy": "now --public --dotenv=.env.prod -d"
  },
    "now": {
    "alias": "lendahand"
  }
}

Greetings. I'm trying to host a project with Zeit but I am getting an error I don't know how to fix. The error is saying that now is not an internal or external command, but it appears to be showing up in my package.json. I don't know how to remedy this situation. Do you have any suggestions?

The error is:

 persona-project2-front@0.1.0 deploy C:\Users\Kim\DevMountain\LendAHandPP
> now --public --dotenv=.env.prod -d

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

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! persona-project2-front@0.1.0 deploy: `now --public --
dotenv=.env.prod -d`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the persona-project2-front@0.1.0 deploy 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\Kim\AppData\Roaming\npm-cache\_logs\2017-11-
06T23_38_07_616Z-debug.log
  • Silly question but: do you have "now" installed as one of the packages via NPM? If so, remove the "now" command from your package.json - I believe it runs automagically @ScaryBelles – prestonsmith Aug 27 '18 at 21:35

1 Answers1

1

Add the directory that now exists in to your PATH/path environmental variable, then you can use now. Make sure to close and re-open your terminal for the env. var. to take effect.

If that's not working, first make sure to install now like this:

npm install now -g to install it globally in your global npm/node_modules directory.

Then test it.

Thirdly, if that is not working, it could be a problem with the environmental variable not being set, so you may need to get root/administrator access and set that in the PATH env var for your system. As for the terminal, maybe try opening your terminal with admin access, or if on linux try something like sudo now.

Finally, after doing your npm install now -g it should display some messages like '... -> C:\Users\\AppData\Roaming\npm\node_modules\now\download\dist\now ...' Use that directory to work with now. This would open now process inside your terminal, your directory to now may be different, make sure to set this directory in your PATH if possible.

George
  • 2,330
  • 3
  • 15
  • 36