React/Node deployment on Netlify
I recently deployed an app to heroku. But I want to know how to deploy this same app to Netlify.
I created a script that works fine in Heroku :
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix
client && npm run build --prefix client".
I added the same global variables as I did in Heroku and I also run the same script but I get this error:
2:34:44 PM: Error running command: Build script returned non-zero exit
code: 127
2:34:44 PM: Failing build: Failed to build site
2:34:44 PM: failed during stage 'building site': Build script returned
non-zero exit code: 127
2:34:44 PM: Finished processing build request in 25.404662076s
client package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"classnames": "^2.2.5",
"jwt-decode": "^2.2.0",
"moment": "^2.22.0",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-moment": "^0.7.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000"
}
server package.json
{
"name": "devconnector",
"version": "1.0.0",
"description": "Social network for developers",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --
prefix client && npm run build --prefix client"
},
"author": "Brad Traversy",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"concurrently": "^3.5.1",
"express": "^4.16.3",
"gravatar": "^1.6.0",
"jsonwebtoken": "^8.2.0",
"mongoose": "^5.0.12",
"netlify-cli": "^1.2.3",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"validator": "^9.4.1"
},
"devDependencies": {
"nodemon": "^1.17.3"
}
}
node.js reactjs heroku mern netlify
add a comment |
I recently deployed an app to heroku. But I want to know how to deploy this same app to Netlify.
I created a script that works fine in Heroku :
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix
client && npm run build --prefix client".
I added the same global variables as I did in Heroku and I also run the same script but I get this error:
2:34:44 PM: Error running command: Build script returned non-zero exit
code: 127
2:34:44 PM: Failing build: Failed to build site
2:34:44 PM: failed during stage 'building site': Build script returned
non-zero exit code: 127
2:34:44 PM: Finished processing build request in 25.404662076s
client package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"classnames": "^2.2.5",
"jwt-decode": "^2.2.0",
"moment": "^2.22.0",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-moment": "^0.7.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000"
}
server package.json
{
"name": "devconnector",
"version": "1.0.0",
"description": "Social network for developers",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --
prefix client && npm run build --prefix client"
},
"author": "Brad Traversy",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"concurrently": "^3.5.1",
"express": "^4.16.3",
"gravatar": "^1.6.0",
"jsonwebtoken": "^8.2.0",
"mongoose": "^5.0.12",
"netlify-cli": "^1.2.3",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"validator": "^9.4.1"
},
"devDependencies": {
"nodemon": "^1.17.3"
}
}
node.js reactjs heroku mern netlify
post ur package json file
– Gautam Naik
Aug 17 '18 at 20:56
I have two. One for the Client and one for the Backend
– Raul Sanchez
Aug 17 '18 at 21:12
That isn't enough information to debug. The error is caused by some line further up the deploy logs that you haven't included. Either post your full deploy logs (or a link to them if they are public - you can change that setting in the build & deploy settings configuration), or contact the helpdesk with a link to the deploy logs to get better advice: support@netlify.com
– fool
Aug 17 '18 at 22:12
Netlify is for building and deploying static sites ... you're barking up the wrong tree trying to deploy a node server to it.
– Jed Richards
Nov 24 '18 at 15:59
add a comment |
I recently deployed an app to heroku. But I want to know how to deploy this same app to Netlify.
I created a script that works fine in Heroku :
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix
client && npm run build --prefix client".
I added the same global variables as I did in Heroku and I also run the same script but I get this error:
2:34:44 PM: Error running command: Build script returned non-zero exit
code: 127
2:34:44 PM: Failing build: Failed to build site
2:34:44 PM: failed during stage 'building site': Build script returned
non-zero exit code: 127
2:34:44 PM: Finished processing build request in 25.404662076s
client package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"classnames": "^2.2.5",
"jwt-decode": "^2.2.0",
"moment": "^2.22.0",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-moment": "^0.7.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000"
}
server package.json
{
"name": "devconnector",
"version": "1.0.0",
"description": "Social network for developers",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --
prefix client && npm run build --prefix client"
},
"author": "Brad Traversy",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"concurrently": "^3.5.1",
"express": "^4.16.3",
"gravatar": "^1.6.0",
"jsonwebtoken": "^8.2.0",
"mongoose": "^5.0.12",
"netlify-cli": "^1.2.3",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"validator": "^9.4.1"
},
"devDependencies": {
"nodemon": "^1.17.3"
}
}
node.js reactjs heroku mern netlify
I recently deployed an app to heroku. But I want to know how to deploy this same app to Netlify.
I created a script that works fine in Heroku :
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix
client && npm run build --prefix client".
I added the same global variables as I did in Heroku and I also run the same script but I get this error:
2:34:44 PM: Error running command: Build script returned non-zero exit
code: 127
2:34:44 PM: Failing build: Failed to build site
2:34:44 PM: failed during stage 'building site': Build script returned
non-zero exit code: 127
2:34:44 PM: Finished processing build request in 25.404662076s
client package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"classnames": "^2.2.5",
"jwt-decode": "^2.2.0",
"moment": "^2.22.0",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-moment": "^0.7.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000"
}
server package.json
{
"name": "devconnector",
"version": "1.0.0",
"description": "Social network for developers",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --
prefix client && npm run build --prefix client"
},
"author": "Brad Traversy",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"concurrently": "^3.5.1",
"express": "^4.16.3",
"gravatar": "^1.6.0",
"jsonwebtoken": "^8.2.0",
"mongoose": "^5.0.12",
"netlify-cli": "^1.2.3",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"validator": "^9.4.1"
},
"devDependencies": {
"nodemon": "^1.17.3"
}
}
node.js reactjs heroku mern netlify
node.js reactjs heroku mern netlify
edited Aug 17 '18 at 21:17
Raul Sanchez
asked Aug 17 '18 at 20:45
Raul SanchezRaul Sanchez
43
43
post ur package json file
– Gautam Naik
Aug 17 '18 at 20:56
I have two. One for the Client and one for the Backend
– Raul Sanchez
Aug 17 '18 at 21:12
That isn't enough information to debug. The error is caused by some line further up the deploy logs that you haven't included. Either post your full deploy logs (or a link to them if they are public - you can change that setting in the build & deploy settings configuration), or contact the helpdesk with a link to the deploy logs to get better advice: support@netlify.com
– fool
Aug 17 '18 at 22:12
Netlify is for building and deploying static sites ... you're barking up the wrong tree trying to deploy a node server to it.
– Jed Richards
Nov 24 '18 at 15:59
add a comment |
post ur package json file
– Gautam Naik
Aug 17 '18 at 20:56
I have two. One for the Client and one for the Backend
– Raul Sanchez
Aug 17 '18 at 21:12
That isn't enough information to debug. The error is caused by some line further up the deploy logs that you haven't included. Either post your full deploy logs (or a link to them if they are public - you can change that setting in the build & deploy settings configuration), or contact the helpdesk with a link to the deploy logs to get better advice: support@netlify.com
– fool
Aug 17 '18 at 22:12
Netlify is for building and deploying static sites ... you're barking up the wrong tree trying to deploy a node server to it.
– Jed Richards
Nov 24 '18 at 15:59
post ur package json file
– Gautam Naik
Aug 17 '18 at 20:56
post ur package json file
– Gautam Naik
Aug 17 '18 at 20:56
I have two. One for the Client and one for the Backend
– Raul Sanchez
Aug 17 '18 at 21:12
I have two. One for the Client and one for the Backend
– Raul Sanchez
Aug 17 '18 at 21:12
That isn't enough information to debug. The error is caused by some line further up the deploy logs that you haven't included. Either post your full deploy logs (or a link to them if they are public - you can change that setting in the build & deploy settings configuration), or contact the helpdesk with a link to the deploy logs to get better advice: support@netlify.com
– fool
Aug 17 '18 at 22:12
That isn't enough information to debug. The error is caused by some line further up the deploy logs that you haven't included. Either post your full deploy logs (or a link to them if they are public - you can change that setting in the build & deploy settings configuration), or contact the helpdesk with a link to the deploy logs to get better advice: support@netlify.com
– fool
Aug 17 '18 at 22:12
Netlify is for building and deploying static sites ... you're barking up the wrong tree trying to deploy a node server to it.
– Jed Richards
Nov 24 '18 at 15:59
Netlify is for building and deploying static sites ... you're barking up the wrong tree trying to deploy a node server to it.
– Jed Richards
Nov 24 '18 at 15:59
add a comment |
1 Answer
1
active
oldest
votes
Netlify isn't as straight forward as Heroku when trying to deploy a backend. Basic answer, you can't.
https://www.netlify.com/docs/functions/
There is a way to make it work, see above link, but I don't know how to do it.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51902639%2freact-node-deployment-on-netlify%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Netlify isn't as straight forward as Heroku when trying to deploy a backend. Basic answer, you can't.
https://www.netlify.com/docs/functions/
There is a way to make it work, see above link, but I don't know how to do it.
add a comment |
Netlify isn't as straight forward as Heroku when trying to deploy a backend. Basic answer, you can't.
https://www.netlify.com/docs/functions/
There is a way to make it work, see above link, but I don't know how to do it.
add a comment |
Netlify isn't as straight forward as Heroku when trying to deploy a backend. Basic answer, you can't.
https://www.netlify.com/docs/functions/
There is a way to make it work, see above link, but I don't know how to do it.
Netlify isn't as straight forward as Heroku when trying to deploy a backend. Basic answer, you can't.
https://www.netlify.com/docs/functions/
There is a way to make it work, see above link, but I don't know how to do it.
answered Nov 24 '18 at 15:38
stefan.kenyonstefan.kenyon
571112
571112
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51902639%2freact-node-deployment-on-netlify%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
post ur package json file
– Gautam Naik
Aug 17 '18 at 20:56
I have two. One for the Client and one for the Backend
– Raul Sanchez
Aug 17 '18 at 21:12
That isn't enough information to debug. The error is caused by some line further up the deploy logs that you haven't included. Either post your full deploy logs (or a link to them if they are public - you can change that setting in the build & deploy settings configuration), or contact the helpdesk with a link to the deploy logs to get better advice: support@netlify.com
– fool
Aug 17 '18 at 22:12
Netlify is for building and deploying static sites ... you're barking up the wrong tree trying to deploy a node server to it.
– Jed Richards
Nov 24 '18 at 15:59