Skip to content

Beginner help - require('parse-server') without building the repository. #429

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

Closed
omairvaiyani opened this issue Feb 15, 2016 · 8 comments
Closed

Comments

@omairvaiyani
Copy link
Contributor

Issue 336 was closed so I decided to open a new one.

I'm somewhat of a beginner with concepts such as babel. There seems to have been a significant folder structure change in 2.0.8 which I feel hasn't been made clear in the README.md.

Using require('parse-server') results in a cannot find module error. Looking into the package.json, I see the the main file points to the lib folder, which doesn't exist and has been added to gitignore. What are the steps we should take to run the server with the latest build?

@polo2244
Copy link

I need the answer to this question too, since parse-server has been updated more frequently than
parse-server-example and is now at build 2.0.8. (rather than 1.0.0)

It was pointed out to me to change the
{ "name": "parse-server-example", "version": "1.0.0", "description": "An example Parse API server using the parse-server module", "main": "index.js", ... inside package.son to 2.0.8 and it should work. But i don't think this is the way to do it.

@mchun
Copy link

mchun commented Feb 16, 2016

+1

@edualm
Copy link

edualm commented Feb 16, 2016

I was able to fix this by:

  1. Going into the node_modules/parse-server directory
  2. npm install babel-cli -g (not sure if -g is needed, but I didn't try otherwise)
  3. npm install babel-preset-es2015
  4. npm run build

My app loaded afterwards.

@omairvaiyani
Copy link
Contributor Author

@MegaEduX Thanks! But unfortunately that method will not work when you deploy your server to heroku/AWS, unless you set it to run that code per build but it would become messy.

@oclef
Copy link

oclef commented Feb 18, 2016

You can fork the master branch, build it and commit to your own repo. Then you can checkout from there.

@drew-gross
Copy link
Contributor

This issue should be fixed in Parse Server 2.1.0. Please open a new issue if you still have problems.

@KunalKathrotia
Copy link

not able to perform execute node index.js, keeps reporting error that can not find module 'parse-server' with version 2.1.3 as well.

@omairvaiyani
Copy link
Contributor Author

You'll have to o open another issue and reference this one. I'm still facing the same issue and have to fork the library, run npm install to build the lib folder, and then remove lib from gitignore.

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

7 participants