Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Express deployment to Zeit fails "cd build && serve -s ./" #1454

Closed
darielnoel opened this issue Jan 10, 2019 · 9 comments
Closed

Express deployment to Zeit fails "cd build && serve -s ./" #1454

darielnoel opened this issue Jan 10, 2019 · 9 comments

Comments

@darielnoel
Copy link

🐛 bug report

Description of the problem

When deploying a Node server to ZEIT, I'm receiving the following error in NOW console:

cd build && serve -s ./
sh: cd: line 1: can't cd to build

Note: For more details please see entire log below.

How has this issue affected you? What are you trying to accomplish?

Deploying the following sandbox to ZEIT:

https://codesandbox.io/s/503jw474wl

Link to sandbox: link

Your Environment

Software Name/Version
Сodesandbox https://codesandbox.io/s/503jw474wl
Browser Chrome
Operating System Mac Sierra

ZEIT logs

01/10 02:14 PM (6m)
yarn
01/10 02:14 PM (6m)
yarn install v1.12.3
01/10 02:14 PM (6m)
warning package.json: No license field
01/10 02:14 PM (6m)
info No lockfile found.
01/10 02:14 PM (6m)
warning csb-503jw474wl@1.0.0: No license field
01/10 02:14 PM (6m)
[1/4] Resolving packages...
01/10 02:14 PM (6m)
[2/4] Fetching packages...
01/10 02:14 PM (6m)
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
01/10 02:14 PM (6m)
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
01/10 02:14 PM (6m)
[3/4] Linking dependencies...
01/10 02:14 PM (6m)
[4/4] Building fresh packages...
01/10 02:14 PM (6m)
success Saved lockfile.
01/10 02:14 PM (6m)
Done in 10.04s.
01/10 02:14 PM (6m)
Snapshotting deployment
01/10 02:14 PM (6m)
Saving deployment image (1.9M)
01/10 02:14 PM (6m)
npm run now-start
01/10 02:14 PM (6m)
01/10 02:14 PM (6m)
> csb-503jw474wl@1.0.0 now-start /home/nowuser/src
01/10 02:14 PM (6m)
> cd build && serve -s ./
01/10 02:14 PM (6m)
01/10 02:14 PM (6m)
sh: cd: line 1: can't cd to build
01/10 02:14 PM (6m)
npm ERR! code ELIFECYCLE
01/10 02:14 PM (6m)
npm ERR! errno 2
01/10 02:14 PM (6m)
npm ERR! csb-503jw474wl@1.0.0 now-start: `cd build && serve -s ./`
01/10 02:14 PM (6m)
npm ERR! Exit status 2
01/10 02:14 PM (6m)
npm ERR! 
01/10 02:14 PM (6m)
npm ERR! Failed at the csb-503jw474wl@1.0.0 now-start script.
01/10 02:14 PM (6m)
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
01/10 02:14 PM (6m)
01/10 02:14 PM (6m)
npm ERR! A complete log of this run can be found in:
01/10 02:14 PM (6m)
npm ERR!     /home/nowuser/.npm/_logs/2019-01-10T19_14_31_801Z-debug.log
01/10 02:14 PM (6m)
The process exit before binding to a port. Maybe 'listen()' is missing?
01/10 02:14 PM (6m)
More details: https://err.sh/now-cli/no-open-port-found
01/10 02:14 PM (6m)
npm run now-start
01/10 02:14 PM (6m)
01/10 02:14 PM (6m)
> csb-503jw474wl@1.0.0 now-start /home/nowuser/src
01/10 02:14 PM (6m)
> cd build && serve -s ./
01/10 02:14 PM (6m)
01/10 02:14 PM (6m)
sh: cd: line 1: can't cd to build
01/10 02:14 PM (6m)
npm ERR! code ELIFECYCLE
01/10 02:14 PM (6m)
npm ERR! errno 2
01/10 02:14 PM (6m)
npm ERR! csb-503jw474wl@1.0.0 now-start: `cd build && serve -s ./`
01/10 02:14 PM (6m)
npm ERR! Exit status 2
01/10 02:14 PM (6m)
npm ERR! 
01/10 02:14 PM (6m)
npm ERR! Failed at the csb-503jw474wl@1.0.0 now-start script.
01/10 02:14 PM (6m)
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
01/10 02:14 PM (6m)
01/10 02:14 PM (6m)
npm ERR! A complete log of this run can be found in:
01/10 02:14 PM (6m)
npm ERR!     /home/nowuser/.npm/_logs/2019-01-10T19_14_37_274Z-debug.log
01/10 02:14 PM (6m)
The process exit before binding to a port. Maybe 'listen()' is missing?
01/10 02:14 PM (6m)
More details: https://err.sh/now-cli/no-open-port-found
01/10 02:14 PM (5m)
npm run now-start
01/10 02:14 PM (5m)
01/10 02:14 PM (5m)
> csb-503jw474wl@1.0.0 now-start /home/nowuser/src
01/10 02:14 PM (5m)
> cd build && serve -s ./
01/10 02:14 PM (5m)
01/10 02:14 PM (5m)
sh: cd: line 1: can't cd to build
01/10 02:14 PM (5m)
npm ERR! code ELIFECYCLE
01/10 02:14 PM (5m)
npm ERR! errno 2
01/10 02:14 PM (5m)
npm ERR! csb-503jw474wl@1.0.0 now-start: `cd build && serve -s ./`
01/10 02:14 PM (5m)
npm ERR! Exit status 2
01/10 02:14 PM (5m)
npm ERR! 
01/10 02:14 PM (5m)
npm ERR! Failed at the csb-503jw474wl@1.0.0 now-start script.
01/10 02:14 PM (5m)
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@SaraVieira
Copy link
Contributor

Hey !

For now, unfortunately, there is no going around that.

I have a PR that fixes that https://github.com/CompuIves/codesandbox-client/pull/1417/files

By allowing you to override the now-start

@darielnoel
Copy link
Author

@SaraVieira Thank you so much for the quick response. Are you guys planning to merge and deploy this PR soon?

Best, Dariel

@SaraVieira
Copy link
Contributor

Ives will probably merge this Monday or Tuesday

Sorry

@darielnoel
Copy link
Author

Awesome!!! Thank you @SaraVieira

@SaraVieira
Copy link
Contributor

It was merged and deployed yesterday 🎉

@vivek12345
Copy link
Contributor

@SaraVieira I am facing a similar issue. How can one override the now-start? Is there an option on codesandbox to do the same?

@SaraVieira
Copy link
Contributor

You have to write the now-start command and any command you write will override our default now-start

@vivek12345
Copy link
Contributor

Understood. Thank you 👍

@myhendry
Copy link

myhendry commented Feb 4, 2019

hi. i'm encountering the same issue using codesandbox. where do you write the now-start command? what do you write in the now-start command? is there an example i can refer to? thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants