Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

node.js - foreman says "unexpected EOF" in one of the SAME node app in 2 different places

i have a sample node.js app in directoryA. Then i did foreman start in that directory and it worked fine.

afterwords i copied that app into a new location and tried doing foreman start from there, it didn't work... here is what i did:

$ ########## foreman works fine in directoryA ##########
$ pwd
you/cant/see/me/directoryA
$ foreman start
22:28:30 web.1  | started with pid 80332
22:28:30 web.1  | Listening on 5000
^C

$ ########## copy the same node app from directoryA to directoryB ##########
$ cd ..
$ cp -r ./directoryA ./directoryB
$ cd directoryB

$ ########## foreman doesn't work in directoryB ##########
$ pwd
you/cant/see/me/directoryB
$ foreman start
22:27:28 web.1  | started with pid 80323
22:27:28 web.1  | sh: -c: line 0: unexpected EOF while looking for matching `''
22:27:28 web.1  | sh: -c: line 1: syntax error: unexpected end of file
22:27:28 web.1  | exited with code 2
22:27:28 system | sending SIGTERM to all processes
SIGTERM received

it's the same damn app... it's a simple helloworld express.js app as showed in https://devcenter.heroku.com/articles/getting-started-with-nodejs.

What am i doing wrong here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I was getting the same error. It turns out my path included the file Alex's Projects . Foreman choke and died on the apostrophe in Alex's. I renamed the folder to Alex Projects and it worked AOK. I found the answer to this here.

https://github.com/ddollar/foreman/issues/315


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...