You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I added NODE_ENV in build and start commands in package.json as you suggested in the last module, "scripts": { "dev": "NODE_ENV=development nodemon backend/server.js", "start": "NODE_ENV=production node backend/server.js", "build": "npm install && npm install --prefix frontend && npm run build --prefix frontend" },
The error occurs because Windows doesn't support setting environment variables in the same way as Unix-based systems. To make this work cross-platform, you can use the cross-env package, which allows you to set environment variables across different operating systems in a consistent way.
Steps to Fix:
1. Install cross-env npm install cross-env
2.Update the start & dev script in your package.json: "scripts": { "start": "cross-env NODE_ENV=production node backend/server.js", "dev": "cross-env NODE_ENV=development nodemon backend/server.js" }
3. Try npm run start in your terminal npm run start
When I added NODE_ENV in build and start commands in package.json as you suggested in the last module,
"scripts": { "dev": "NODE_ENV=development nodemon backend/server.js", "start": "NODE_ENV=production node backend/server.js", "build": "npm install && npm install --prefix frontend && npm run build --prefix frontend" },
I faced this error...
` npm run start
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.`
The text was updated successfully, but these errors were encountered: