Comments (7)
I tried on my windows 10 machine. It's indeed not working. The issue lies with the scripts
section of the package.json
. There, start
and serve
break since it's not cross-platform. I get the following error:
'NODE_ENV' is not recognized as an internal or external command, operable program or batch file.
I also got the following warning during npm install
:
npm WARN install Couldn't install optional dependency: Unsupported
I followed advise from HK thread, and added the following dependencies:
"cross-env": "1.0.6"
I then replaced the package.json
lines with:
"start": "cross-env NODE_ENV=development node server.dev.js", "serve": "cross-env NODE_ENV=production node server.prod.js"
It works great now.
from react-boilerplate.
@lwouis thanks so much for trying, any ideas on how to set the NODE_ENV in a cross-OS compatible way?
from react-boilerplate.
Yes, see my updated comment. Very easy fix actually :)
I don't know if it breaks the linux side though!
from react-boilerplate.
From what I remember - it's always an issue with setting the environment variables.
I wasn't aware of 'cross-env' so I solved it differently.
I added a script called 'win' that calls webpack without setting any environment variables and I created a batch file for Windows that calls SET in order to set the desired environment variable and then calls npm run win
.
from react-boilerplate.
Did it with cross-env
, as it worked for @lwouis. Fixed on master now, thanks so much for the help!
from react-boilerplate.
@Iwouis, thanks for your comment on fix for NODE_ENV in Windows - works great now!
from react-boilerplate.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from react-boilerplate.
Related Issues (20)
- Redux Saga API is being called twice yet the action is dispatched only once HOT 1
- npm setup failed: `Error: could not resolve` HOT 4
- The DLL files are missing. Sit back while we build them for you with "npm run build-dll" HOT 1
- not working on macbook
- Include relative static files from index.html HOT 3
- Migration from old boiler plate to CRA base boiler plate
- updating node 12 to node 16 HOT 1
- micro frontend structer HOT 1
- upgrade package and project HOT 1
- ngrok - platform darwinarm64 is not supported HOT 3
- caniuse-lite is outdated HOT 1
- Not able setup react boilerplate on Windows 10 Home Single Language
- Existence of security vulnerabilities
- opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error'
- Actions calling in different containers HOT 1
- Install New Project
- your website is down
- upgrade the project from react-boilerplate to cra-react-boilerplate
- migrating to react-router-dom v6 HOT 1
- How to migrate from react-boilerplate to react CRA? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-boilerplate.