Repository navigation
Parse server with Heroku #472
Description
hello,
I have a parse.com user want to migrate my app to Heroku. However, when I testing the newest parse server source code (that from https://github.com/ParsePlatform/parse-server), only download and deploy Heroku. then got below error message.
I think that src/index.js file is from the Parse team. Could you kindly verify and advise. thanks.
2016-02-17T19:52:36.120656+00:00 heroku[web.1]: Starting process with command npm start
2016-02-17T19:52:39.312161+00:00 app[web.1]:
2016-02-17T19:52:39.312171+00:00 app[web.1]: > [email protected] start /app
2016-02-17T19:52:39.312173+00:00 app[web.1]: > ./bin/parse-server
2016-02-17T19:52:39.312173+00:00 app[web.1]:
2016-02-17T19:52:39.625902+00:00 app[web.1]: /app/src/index.js:14
2016-02-17T19:52:39.625906+00:00 app[web.1]: import { GridStoreAdapter } from './Adapters/Files/GridStoreAdapter';
2016-02-17T19:52:39.625907+00:00 app[web.1]: ^^^^^^
2016-02-17T19:52:39.625908+00:00 app[web.1]:
2016-02-17T19:52:39.625908+00:00 app[web.1]: SyntaxError: Unexpected token import
2016-02-17T19:52:39.625909+00:00 app[web.1]: at exports.runInThisContext (vm.js:53:16)
2016-02-17T19:52:39.625909+00:00 app[web.1]: at Module._compile (module.js:387:25)
2016-02-17T19:52:39.625911+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-02-17T19:52:39.625910+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-17T19:52:39.625912+00:00 app[web.1]: at Module.require (module.js:367:17)
2016-02-17T19:52:39.625912+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-17T19:52:39.625913+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-17T19:52:39.625914+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-17T19:52:39.625915+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-17T19:52:39.625914+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-17T19:52:39.641602+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic
2016-02-17T19:52:39.642067+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-17T19:52:39.631236+00:00 app[web.1]:
2016-02-17T19:52:39.643377+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-17T19:52:39.643666+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-02-17T19:52:39.643896+00:00 app[web.1]: npm ERR! [email protected] start: ./bin/parse-server
2016-02-17T19:52:39.644122+00:00 app[web.1]: npm ERR! Exit status 1
2016-02-17T19:52:39.642384+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-17T19:52:39.644367+00:00 app[web.1]: npm ERR!
2016-02-17T19:52:39.644609+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script './bin/parse-server'.
2016-02-17T19:52:39.645067+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the parse-server package,
2016-02-17T19:52:39.644843+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-02-17T19:52:39.645303+00:00 app[web.1]: npm ERR! not with npm itself.
2016-02-17T19:52:39.645525+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-02-17T19:52:39.646702+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-02-17T19:52:39.646483+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-17T19:52:39.647393+00:00 app[web.1]: npm ERR! npm owner ls parse-server
2016-02-17T19:52:39.653722+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-02-17T19:52:39.647613+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-02-17T19:52:39.646964+00:00 app[web.1]: npm ERR! npm bugs parse-server
2016-02-17T19:52:39.647193+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-02-17T19:52:39.653206+00:00 app[web.1]:
2016-02-17T19:52:39.653719+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
Activity
gnz00 commentedon Feb 18, 2016
You need to use babel,
./node_modules/.bin/babel-node ./bin/parse-server.@flovilmart Should we use ES5 in the binaries?
flovilmart commentedon Feb 18, 2016
It should definitely use lib/index.js instead of the src.
I think it's been like that since the source was refactored
gfosco commentedon Feb 18, 2016
This should definitely be fixed with 2.1.0. Please update and retry.
AnChiChang commentedon Feb 18, 2016
@gfosco thanks. however, I have used the newest version. Got different message. Please kindly help.
2016-02-18T04:37:42.704431+00:00 heroku[web.1]: Process exited with status 1
2016-02-18T04:40:14.070595+00:00 heroku[slug-compiler]: Slug compilation started
2016-02-18T04:40:14.056171+00:00 heroku[web.1]: State changed from crashed to starting
2016-02-18T04:40:16.610978+00:00 heroku[web.1]: Starting process with command
npm start2016-02-18T04:40:19.561818+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic
2016-02-18T04:40:19.562115+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-18T04:40:19.562322+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-18T04:40:19.562781+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-18T04:40:19.562989+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-02-18T04:40:19.563157+00:00 app[web.1]: npm ERR! [email protected] start:
./bin/parse-server2016-02-18T04:40:19.563303+00:00 app[web.1]: npm ERR! Exit status 1
2016-02-18T04:40:19.563466+00:00 app[web.1]: npm ERR!
2016-02-18T04:40:19.548823+00:00 app[web.1]: ^
2016-02-18T04:40:19.548823+00:00 app[web.1]:
2016-02-18T04:40:19.563932+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the parse-server package,
2016-02-18T04:40:19.564080+00:00 app[web.1]: npm ERR! not with npm itself.
2016-02-18T04:40:19.564528+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-18T04:40:19.564810+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-02-18T04:40:19.548826+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-18T04:40:19.548826+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-18T04:40:19.548827+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-18T04:40:19.548828+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-18T04:40:19.548829+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-18T04:40:19.565013+00:00 app[web.1]: npm ERR! npm bugs parse-server
2016-02-18T04:40:19.565173+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-02-18T04:40:20.317645+00:00 heroku[web.1]: State changed from starting to crashed
2016-02-18T04:40:20.295276+00:00 heroku[web.1]: Process exited with status 1
edwardyue commentedon Feb 18, 2016
I also got the similar. I just use git clone to download. Anyone can help?
Thanks!
2016-02-18T15:18:20.133890+00:00 heroku[web.1]: State changed from crashed to starting
2016-02-18T15:18:21.597073+00:00 heroku[web.1]: Starting process with command
npm start2016-02-18T15:18:24.532791+00:00 app[web.1]:
2016-02-18T15:18:24.532823+00:00 app[web.1]:
2016-02-18T15:18:24.532822+00:00 app[web.1]: > ./bin/parse-server
2016-02-18T15:18:24.532820+00:00 app[web.1]: > [email protected] start /app
2016-02-18T15:18:24.963284+00:00 app[web.1]: throw err;
2016-02-18T15:18:24.963278+00:00 app[web.1]: module.js:341
2016-02-18T15:18:24.963288+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-02-18T15:18:24.963286+00:00 app[web.1]:
2016-02-18T15:18:24.963287+00:00 app[web.1]: Error: Cannot find module '../lib/index'
2016-02-18T15:18:24.963289+00:00 app[web.1]: at Function.Module._load (module.js:290:25)
2016-02-18T15:18:24.963293+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-18T15:18:24.963285+00:00 app[web.1]: ^
2016-02-18T15:18:24.963289+00:00 app[web.1]: at Module.require (module.js:367:17)
2016-02-18T15:18:24.963293+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-02-18T15:18:24.963291+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-18T15:18:24.963303+00:00 app[web.1]:
2016-02-18T15:18:24.963290+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-18T15:18:24.963294+00:00 app[web.1]: at Function.Module.runMain (module.js:447:10)
2016-02-18T15:18:24.963305+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-18T15:18:24.963307+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-02-18T15:18:24.963308+00:00 app[web.1]: npm ERR! Exit status 1
2016-02-18T15:18:24.963308+00:00 app[web.1]: npm ERR! [email protected] start:
./bin/parse-server2016-02-18T15:18:24.963309+00:00 app[web.1]: npm ERR!
2016-02-18T15:18:24.963306+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-18T15:18:24.963310+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-02-18T15:18:24.963312+00:00 app[web.1]: npm ERR! not with npm itself.
2016-02-18T15:18:24.963291+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-18T15:18:24.963306+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-18T15:18:24.963292+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-18T15:18:24.963313+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-02-18T15:18:24.963316+00:00 app[web.1]: npm ERR! npm owner ls parse-server
2016-02-18T15:18:24.963314+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-02-18T15:18:24.963304+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic
2016-02-18T15:18:24.963311+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the parse-server package,
2016-02-18T15:18:24.963317+00:00 app[web.1]:
2016-02-18T15:18:24.963319+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-02-18T15:18:24.963316+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-02-18T15:18:24.963310+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script './bin/parse-server'.
2016-02-18T15:18:24.963317+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-02-18T15:18:24.963314+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-18T15:18:24.963318+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-02-18T15:18:24.963315+00:00 app[web.1]: npm ERR! npm bugs parse-server
2016-02-18T15:18:25.755143+00:00 heroku[web.1]: Process exited with status 1
2016-02-18T15:18:25.768973+00:00 heroku[web.1]: State changed from starting to crashed
flovilmart commentedon Feb 18, 2016
It seems that
npm installornpm buildwas not run to build the lib...edwardyue commentedon Feb 19, 2016
I have done npm install. The lib and node_modules directory already created. I am using heroku. Other than npm install, is there any other steps?
Thanks
flovilmart commentedon Feb 19, 2016
@edwardyue does it work on your local machine?
edwardyue commentedon Feb 19, 2016
Seems not working too...but I did get npm warn about monogodb during npm install... Would it be a matter?
flovilmart commentedon Feb 19, 2016
try to remove your ./lib and your ./node_modules and re-run
npm installedwardyue commentedon Feb 19, 2016
Thanks Florent! but i still getting the same error, any thoughts?
2016-02-19T03:42:09.864702+00:00 heroku[web.1]: Starting process with command
npm start2016-02-19T03:42:12.913741+00:00 app[web.1]:
2016-02-19T03:42:12.913753+00:00 app[web.1]: > ./bin/parse-server
2016-02-19T03:42:12.913751+00:00 app[web.1]: > [email protected] start /app
2016-02-19T03:42:12.913753+00:00 app[web.1]:
2016-02-19T03:42:13.535834+00:00 app[web.1]: module.js:341
2016-02-19T03:42:13.535865+00:00 app[web.1]: throw err;
2016-02-19T03:42:13.535896+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-02-19T03:42:13.535898+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-19T03:42:13.535895+00:00 app[web.1]: Error: Cannot find module '../lib/index'
2016-02-19T03:42:13.535897+00:00 app[web.1]: at Function.Module._load (module.js:290:25)
2016-02-19T03:42:13.535875+00:00 app[web.1]: ^
2016-02-19T03:42:13.535884+00:00 app[web.1]:
2016-02-19T03:42:13.535898+00:00 app[web.1]: at Module.require (module.js:367:17)
2016-02-19T03:42:13.535899+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-19T03:42:13.535900+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-19T03:42:13.535900+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-19T03:42:13.535902+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-19T03:42:13.535901+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-02-19T03:42:13.601847+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-02-19T03:42:13.602109+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-02-19T03:42:13.535974+00:00 app[web.1]: at Function.Module.runMain (module.js:447:10)
2016-02-19T03:42:13.548941+00:00 app[web.1]:
2016-02-19T03:42:13.581444+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic
2016-02-19T03:42:13.581972+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-19T03:42:13.582302+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-19T03:42:13.582917+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-19T03:42:13.583213+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-02-19T03:42:13.583474+00:00 app[web.1]: npm ERR! [email protected] start:
./bin/parse-server2016-02-19T03:42:13.583719+00:00 app[web.1]: npm ERR! Exit status 1
2016-02-19T03:42:13.583982+00:00 app[web.1]: npm ERR!
2016-02-19T03:42:13.584197+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script './bin/parse-server'.
2016-02-19T03:42:13.584449+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-02-19T03:42:13.586367+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the parse-server package,
2016-02-19T03:42:13.586654+00:00 app[web.1]: npm ERR! not with npm itself.
2016-02-19T03:42:13.586955+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-02-19T03:42:13.587933+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-19T03:42:13.588233+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-02-19T03:42:13.588503+00:00 app[web.1]: npm ERR! npm bugs parse-server
2016-02-19T03:42:13.588785+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-02-19T03:42:13.589088+00:00 app[web.1]: npm ERR! npm owner ls parse-server
2016-02-19T03:42:13.589348+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-02-19T03:42:13.594201+00:00 app[web.1]:
2016-02-19T03:42:14.709832+00:00 heroku[web.1]: Process exited with status 1
2016-02-19T03:42:15.814719+00:00 heroku[web.1]: Starting process with command
npm start2016-02-19T03:42:17.689207+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic
2016-02-19T03:42:17.689568+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-19T03:42:17.513770+00:00 app[web.1]:
2016-02-19T03:42:17.513783+00:00 app[web.1]: > [email protected] start /app
2016-02-19T03:42:17.689821+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-19T03:42:17.513784+00:00 app[web.1]: > ./bin/parse-server
2016-02-19T03:42:17.690310+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-19T03:42:17.675763+00:00 app[web.1]: module.js:341
2016-02-19T03:42:17.675767+00:00 app[web.1]: ^
2016-02-19T03:42:17.513785+00:00 app[web.1]:
2016-02-19T03:42:17.675768+00:00 app[web.1]:
2016-02-19T03:42:17.690631+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-02-19T03:42:17.690800+00:00 app[web.1]: npm ERR! [email protected] start:
./bin/parse-server2016-02-19T03:42:17.675766+00:00 app[web.1]: throw err;
2016-02-19T03:42:17.675769+00:00 app[web.1]: Error: Cannot find module '../lib/index'
2016-02-19T03:42:17.690958+00:00 app[web.1]: npm ERR! Exit status 1
2016-02-19T03:42:17.691136+00:00 app[web.1]: npm ERR!
2016-02-19T03:42:17.691298+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script './bin/parse-server'.
2016-02-19T03:42:17.675770+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-02-19T03:42:17.691466+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-02-19T03:42:17.675771+00:00 app[web.1]: at Function.Module._load (module.js:290:25)
2016-02-19T03:42:17.675771+00:00 app[web.1]: at Module.require (module.js:367:17)
2016-02-19T03:42:17.675772+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-19T03:42:17.692252+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-19T03:42:17.675775+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-02-19T03:42:17.675776+00:00 app[web.1]: at Function.Module.runMain (module.js:447:10)
2016-02-19T03:42:17.675772+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-19T03:42:17.691627+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the parse-server package,
2016-02-19T03:42:17.692406+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-02-19T03:42:17.691786+00:00 app[web.1]: npm ERR! not with npm itself.
2016-02-19T03:42:17.675773+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-19T03:42:17.691949+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-02-19T03:42:17.675774+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-19T03:42:17.675775+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-19T03:42:17.682154+00:00 app[web.1]:
2016-02-19T03:42:17.692629+00:00 app[web.1]: npm ERR! npm bugs parse-server
2016-02-19T03:42:17.692777+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-02-19T03:42:17.693082+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-02-19T03:42:17.692937+00:00 app[web.1]: npm ERR! npm owner ls parse-server
2016-02-19T03:42:17.697038+00:00 app[web.1]:
2016-02-19T03:42:17.697241+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-02-19T03:42:17.697390+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-02-19T03:42:18.442572+00:00 heroku[web.1]: State changed from starting to crashed
2016-02-19T03:42:18.428861+00:00 heroku[web.1]: Process exited with status 1
edwardyue commentedon Feb 19, 2016
it seems that the root cause it that ../lib/index cannot be found.... any idea how to fix it?
flovilmart commentedon Feb 19, 2016
does it run locally?
edwardyue commentedon Feb 19, 2016
yes..i can run it locally but just getting {"error":"unauthorized"}
edwardyue commentedon Feb 19, 2016
but at least it could launch the URL...
6 remaining items
edwardyue commentedon Feb 19, 2016
I don't think you need to add index.js
The index.js already in Src folder. And when you run npm install, it will
generate one in lib folder. You have to commit everything after npm
install to git and then you should make it works.
AnChiChang [email protected] 於 2016年2月19日星期五 寫道:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 19, 2016
@edwardyue
thanks for your info. I had download all doc from git. and only modify index.js under src like below.
but still got error message. Could you kindly help?
var batch = require('./batch'),
bodyParser = require('body-parser'),
cache = require('./cache'),
DatabaseAdapter = require('./DatabaseAdapter'),
express = require('express'),
middlewares = require('./middlewares'),
multer = require('multer'),
Parse = require('parse/node').Parse,
PromiseRouter = require('./PromiseRouter'),
httpRequest = require('./httpRequest');
import { GridStoreAdapter } from './Adapters/Files/GridStoreAdapter';
import { S3Adapter } from './Adapters/Files/S3Adapter';
import { FilesController } from './Controllers/FilesController';
import ParsePushAdapter from './Adapters/Push/ParsePushAdapter';
import { PushController } from './Controllers/PushController';
import { ClassesRouter } from './Routers/ClassesRouter';
import { InstallationsRouter } from './Routers/InstallationsRouter';
import { UsersRouter } from './Routers/UsersRouter';
import { SessionsRouter } from './Routers/SessionsRouter';
import { RolesRouter } from './Routers/RolesRouter';
import { FileLoggerAdapter } from './Adapters/Logger/FileLoggerAdapter';
import { LoggerController } from './Controllers/LoggerController';
// Mutate the Parse object to add the Cloud Code handlers
addParseCloud();
var api = new ParseServer({
databaseURI: 'mongodb://xxxxxx',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: 'xxxx',
masterKey: 'xxxx',
clientKey: 'xxxx'
});
// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);
app.listen(1337, function() {
console.log('parse-server-example running on port 1337.');
});
function ParseServer(args) {
if (!args.appId || !args.masterKey) {
throw 'You must provide an appId and masterKey!';
}
.......
after deploy got below error message:
2016-02-19T07:29:32.025665+00:00 heroku[web.1]: State changed from crashed to starting
2016-02-19T07:29:33.814964+00:00 heroku[web.1]: Starting process with command
npm start2016-02-19T07:29:37.308378+00:00 app[web.1]:
2016-02-19T07:29:37.308388+00:00 app[web.1]: > [email protected] start /app
2016-02-19T07:29:37.308390+00:00 app[web.1]: > ./bin/parse-server
2016-02-19T07:29:37.765082+00:00 app[web.1]: npm ERR! Linux 3.13.0-77-generic
2016-02-19T07:29:37.792621+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-02-19T07:29:37.792841+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-02-19T07:29:37.696240+00:00 app[web.1]: module.js:341
2016-02-19T07:29:37.696245+00:00 app[web.1]: throw err;
2016-02-19T07:29:37.696246+00:00 app[web.1]: ^
2016-02-19T07:29:37.696247+00:00 app[web.1]:
2016-02-19T07:29:37.696252+00:00 app[web.1]: Error: Cannot find module '../lib/index'
2016-02-19T07:29:37.696254+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-02-19T07:29:37.696256+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-19T07:29:37.696256+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-19T07:29:37.696257+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-19T07:29:37.696258+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-19T07:29:37.696258+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-02-19T07:29:37.696259+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-19T07:29:37.696259+00:00 app[web.1]: at Function.Module.runMain (module.js:447:10)
2016-02-19T07:29:37.727006+00:00 app[web.1]:
2016-02-19T07:29:37.766391+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-19T07:29:37.766986+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-19T07:29:37.776790+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-02-19T07:29:37.781773+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-19T07:29:37.781989+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-02-19T07:29:37.782216+00:00 app[web.1]: npm ERR! npm bugs parse-server
2016-02-19T07:29:37.782413+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-02-19T07:29:37.787798+00:00 app[web.1]:
2016-02-19T07:29:38.725843+00:00 heroku[web.1]: Process exited with status 1
2016-02-19T07:29:38.740118+00:00 heroku[web.1]: State changed from starting to crashed
2016-02-19T07:29:38.741176+00:00 heroku[web.1]: State changed from crashed to starting
edwardyue commentedon Feb 19, 2016
I actually have not amend the index.js but bin/pares-server. In that file,
it will call index.js and I also just add the masterkey, appid and
clientkey in that file.
E.g. Amend the line options.Masterkey = 'your key'
AnChiChang [email protected] 於 2016年2月19日星期五 寫道:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 19, 2016
@edwardyue
thanks, I had undo src/index.js, and modify bin/parse-server according your instruction. and deploy to heroku, got following error message
2016-02-19T07:55:34.395243+00:00 heroku[web.1]: Starting process with command
npm start2016-02-19T07:55:37.256608+00:00 app[web.1]:
2016-02-19T07:55:37.256628+00:00 app[web.1]: > [email protected] start /app
2016-02-19T07:55:37.256629+00:00 app[web.1]: > ./bin/parse-server
2016-02-19T07:55:37.256630+00:00 app[web.1]:
2016-02-19T07:55:37.558166+00:00 app[web.1]: npm ERR! Linux 3.13.0-77-generic
2016-02-19T07:55:37.558169+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-19T07:55:37.558170+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-19T07:55:37.558170+00:00 app[web.1]: npm ERR! npm v3.6.0
2016-02-19T07:55:37.558171+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-02-19T07:55:37.558173+00:00 app[web.1]: npm ERR!
2016-02-19T07:55:37.558174+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script './bin/parse-server'.
2016-02-19T07:55:37.558175+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-02-19T07:55:37.558175+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the parse-server package,
2016-02-19T07:55:37.558176+00:00 app[web.1]: npm ERR! not with npm itself.
2016-02-19T07:55:37.537992+00:00 app[web.1]: module.js:341
2016-02-19T07:55:37.558177+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-02-19T07:55:37.558177+00:00 app[web.1]: npm ERR! ./bin/parse-server
2016-02-19T07:55:37.561996+00:00 app[web.1]:
2016-02-19T07:55:37.562281+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-02-19T07:55:37.537999+00:00 app[web.1]: throw err;
2016-02-19T07:55:37.538000+00:00 app[web.1]: ^
2016-02-19T07:55:37.538001+00:00 app[web.1]:
2016-02-19T07:55:37.562491+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-02-19T07:55:37.538001+00:00 app[web.1]: Error: Cannot find module '../lib/index'
2016-02-19T07:55:37.538002+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-02-19T07:55:37.538002+00:00 app[web.1]: at Function.Module._load (module.js:290:25)
2016-02-19T07:55:37.538003+00:00 app[web.1]: at Module.require (module.js:367:17)
2016-02-19T07:55:37.538003+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-19T07:55:37.538004+00:00 app[web.1]: at Object. (/app/bin/parse-server:3:19)
2016-02-19T07:55:37.538004+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-19T07:55:37.538005+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-19T07:55:37.538006+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-02-19T07:55:37.538006+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-02-19T07:55:37.538007+00:00 app[web.1]: at Function.Module.runMain (module.js:447:10)
2016-02-19T07:55:37.548588+00:00 app[web.1]:
2016-02-19T07:55:38.399825+00:00 heroku[web.1]: Process exited with status 1
2016-02-19T07:55:38.418040+00:00 heroku[web.1]: State changed from starting to crashed
edwardyue commentedon Feb 19, 2016
That exactly same as mine before... U have not commit the lib and
node_modules to heroku..
In parse-server directory, Try to type
git add * -A -f
git commit -m "add everything"
git push master heroku
AnChiChang [email protected] 於 2016年2月19日星期五 寫道:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 19, 2016
@edwardyue
in the root of parse server foloer. and type below. nothing to commit, working directory clean
AN-CHICHANGdeMacBook-Pro:parse-server-20160216 anchi$ git add * -A -f
AN-CHICHANGdeMacBook-Pro:parse-server-20160216 anchi$ git commit -am "new version 20160218 07"
On branch master
nothing to commit, working directory clean
AN-CHICHANGdeMacBook-Pro:parse-server-20160216 anchi$ git push master heroku
error: src refspec heroku does not match any.
error: failed to push some refs to 'master'
edwardyue commentedon Feb 19, 2016
Maybe u try explicitly add lib and node_modules?
git add lib -f
git add node_modules -f
On your last command, it should be git push heroku master
AnChiChang [email protected] 於 2016年2月19日星期五 寫道:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 19, 2016
@edwardyue
I could not found lib and node_modules in my parse server folder, Did I miss to download??
edwardyue commentedon Feb 19, 2016
This two directory are generated by "npm install"
Have u ran this command before?
AnChiChang [email protected] 於 2016年2月19日星期五 寫道:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 19, 2016
@edwardyue
thanks looks fine, i can use browser view my page in heroku, will display "Heroku | Welcome to your new app!"
however, In heroku log, after commit, system display below message:
2016-02-19T10:05:21.130952+00:00 heroku[slug-compiler]: Slug compilation started
2016-02-19T10:05:21.130962+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Node.js app
and My App (iOS by swift) still can't get PFObject info...
let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
ParseMutableClientConfiguration.applicationId = "xxxxxx"
ParseMutableClientConfiguration.clientKey = "xxxxxx"
ParseMutableClientConfiguration.server = "https://xxxxx.herokuapp.com/parse"
})
edwardyue commentedon Feb 19, 2016
I think u are not using latest parse sdk..
AnChiChang [email protected] 於 2016年2月19日星期五 寫道:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 19, 2016
@edwardyue
I use parse sdk version 1.12, got below message
2016-02-19 19:17:59.337 GroupBuy[10813:3476362] [Error]: Failed to run command eventually with error: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
Optional("Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}")
edwardyue commentedon Feb 19, 2016
sorry i don't know this too...as i just played parse for 2 weeks....
I think you may need parse expert to answer your questions
On Fri, Feb 19, 2016 at 7:19 PM, AnChiChang [email protected]
wrote:
Thanks and Regards,
Edward Chan Woon Yue
AnChiChang commentedon Feb 20, 2016
@edwardyue
I think my parse server in Heroku is not running.
[email protected] node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/kerberos
[email protected] /tmp/build_fee275e19d1949f9908727ac9689342d
????????? (empty)
npm ERR! code 1
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
can I verify my step with your?
right?
edwardyue commentedon Feb 20, 2016
Yes I follow the exact steps. But I think it could be better to run npm
install before heroku create
AnChiChang [email protected] 於 2016年2月20日星期六 寫道:
Thanks and Regards,
Edward Chan Woon Yue