heroku / wywh

WYWH (your-wywh-app.heroku.com) - Take a photo, add flair and share.
21 stars 36 forks source link

"'NODE_ENV' is not recognized" error when building on windows 10 #12

Open vinceswann opened 8 years ago

vinceswann commented 8 years ago
C:\git\wywh>npm install
> heroku-event-signup@1.0.0 postinstall C:\git\wywh
> npm run build
> heroku-event-signup@1.0.0 build C:\git\wywh
> NODE_ENV=production webpack
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! heroku-event-signup@1.0.0 build: `NODE_ENV=production webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the heroku-event-signup@1.0.0 build script 'NODE_ENV=production webpack'.

Fixed by altering line 65 of package.json from: "build": "NODE_ENV=production webpack",

To: "build": "set NODE_ENV=production webpack",

... which allowed it to build however the added set command would presumably then cause a similar issue if this alteration was built on Mac or Linux. I'm not yet aware how to fix this cross-platform.

armanbabai commented 6 years ago

in package.json file: "build": "SET NODE_ENV=production webpack",

remjx commented 4 years ago

I think this is unrelated but i'll leave this here anyway in case it helps anyone...

I got a similar error when i installed with npm but accidentally tried to run with yarn.

anandbaburajan commented 3 years ago

I'm not yet aware how to fix this cross-platform.

https://stackoverflow.com/a/37131308/6320130