Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nosizejosh opened this issue Oct 21, 2018 · 6 comments

Comments

@nosizejosh
Copy link

nosizejosh commented Oct 21, 2018

the back-end will not run on Windows, after following all the steps due to the error

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

only way to get back-end to run is to edit the script source in package.json to

"scripts": {
"start": "npm run start:local",
"start:local": "SET NODE_ENV=local & nodemon index.js",
"start:dev": "SET NODE_ENV=development & nodemon index.js",
"start:prod": "SET NODE_ENV=production & node index.js",
"test": "jest --coverage",
"seed": "node scripts/seed.js",
"update-permissions": "node scripts/update-permissions.js",
"precommit": "lint-staged",
"lint": "eslint --fix **/*.js ./"
},

as explained here

@nosizejosh nosizejosh changed the title 'NODE_ENV' is not recognized as an internal or external command, operable program or batch file. 'NODE_ENV' is not recognized as an internal or external command, operable program or batch file. Windows Oct 21, 2018
@JKHeadley
Copy link
Owner

@nosizejosh would you mind testing this module to see if it works for you (with the original script command)?

@nosizejosh
Copy link
Author

@JKHeadley which module?

@JKHeadley
Copy link
Owner

@nosizejosh sorry, forgot to link it:
https://github.com/laggingreflex/win-node-env

@nosizejosh
Copy link
Author

saw this while trying to troubleshoot, knew it would work but didn't want to just fix without reporting, also my fix was actually to place it as dependency in packages.json

@nosizejosh
Copy link
Author

trying to create a pull request with below but its too much to clone the whole repo just for this small change. Adding the win-node-env does work as I suspected. I however added as a dependency instead of install globally.

"dependencies": {
"aws-sdk": "^2.175.0",
"bcryptjs": "^2.4.0",
"bell": "^9.3.0",
"boom": "^7.2.0",
"chalk": "*",
"confidence": "^3.0.2",
"dotenv": "^2.0.0",
"faker": "^4.1.0",
"glue": "^5.0.0",
"handlebars": "^4.0.6",
"hapi-auth-jwt2": "salzhrani/hapi-auth-jwt2#v-17",
"imagemagick": "^0.1.3",
"iplocation": "^5.0.0",
"joi": "^13.3.0",
"jsonwebtoken": "^7.1.9",
"lodash": "~3.10.1",
"lodash-pickdeep": "^1.0.2",
"mongoose": "5.0.9",
"nes": "^8.1.0",
"node-uuid": "^1.4.7",
"nodemailer": "^2.6.4",
"nodemailer-markdown": "^1.0.1",
"owasp-password-strength-test": "^1.3.0",
"password-generator": "^2.2.0",
"q": "^1.4.1",
"request-promise": "^4.2.2",
"require-dir": "^0.3.2",
"rest-hapi": "^1.2.0",
"useragent": "^2.3.0",
"zxcvbn": "^4.4.2",
"win-node-env": "^0.3.0"
},

@le-incroyable1-dev
Copy link

Lol it's been like six years but if anyone is still stuck on this check this link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants