Comments (6)
Hi Coord,
I am having the exact same issue. What code changes did you make to run the demo? After I simply switch to "exec" from "spawn" and define "exec", it still fails. Appreciate if you could shed more light.
const exec = require('child_process').exec;
const client = exec('./node_modules/.bin/react-scripts', ['start'], {
env: Object.assign({}, process.env, {
REACT_APP_SERVER: 'http://localhost:5000',
}),
stdio: 'inherit',
});
Thanks
Lee
from discovery-nodejs.
Hi Lee,
Here is my updated start.js file:
const exec = require('child_process').exec;
const server = require('../server');
const client = exec(__dirname + '/../node_modules/.bin/react-scripts start', {
env: Object.assign({}, process.env, {
REACT_APP_SERVER: 'http://localhost:5000',
})
}, (error, stdout, stderr) => {
if (error) {
// eslint-disable-next-line no-console
console.log(`ERROR: ${error}`);
killServer(() => {
process.exit(1);
});
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
function killServer(callback) {
const ppid = server.pid;
const killer = exec('pkill -9 -P ' + ppid);
killer.on('exit', () => {
// eslint-disable-next-line no-console
console.log(`PPID ${ppid} killed`);
if (callback) {
callback();
}
});
}
I also had to change one of the script commands in package.json to make it work correctly:
"build": "./node_modules/.bin/react-scripts build"
I did these changes relatively quickly, so it may be a little hacky. Let me know if you find a better solution :)
from discovery-nodejs.
Thank you, Coord,
from discovery-nodejs.
@maniax89 do you think you can take a look at this? @Coord sent me an email and I think this is one of the changes your team did to adopt create-react-app
from discovery-nodejs.
I have made a fix in #91 and it should work cross-platform now (sorry about that)
as for appending the ./node_modules/.bin
-> I have removed this from all code as any script run with npm run
supposedly adds the ./node_modules/.bin
to the $PATH
, thus we should never need to include it in scripts.
Let us know if you still have issues
from discovery-nodejs.
🎉 This issue has been resolved in version 1.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from discovery-nodejs.
Related Issues (12)
- Can't deploy to cloud HOT 3
- can't deploy app to cloud HOT 4
- Demo code fails to start on IBM Cloud HOT 5
- a
- Error: Request to Query service was timed out since a response was not received within 20 seconds. HOT 1
- Pain points with "View Query" HOT 1
- Change titles for consistency HOT 3
- Trying to Deploy on BlueMix by Pressing button on ReadMe fails with the following errors HOT 2
- Not Authorized error When searching in discovery-nodejs from localhost HOT 2
- Odd behavior when loading the demo from various sites HOT 2
- Add telium HOT 2
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 discovery-nodejs.