Skip to content

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

Description

@omairvaiyani

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?

Activity

  1. polo2244 commented on Feb 15, 2016

    @polo2244

    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.

  2. mchun commented on Feb 16, 2016

    @mchun

    +1

  3. edualm commented on Feb 16, 2016

    @edualm

    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.

  4. omairvaiyani commented on Feb 17, 2016

    @omairvaiyani
    ContributorAuthor

    @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.

  5. oclef commented on Feb 18, 2016

    @oclef

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

  6. drew-gross commented on Feb 18, 2016

    @drew-gross
    Contributor

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

  7. KunalKathrotia commented on Feb 27, 2016

    @KunalKathrotia

    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.

  8. omairvaiyani commented on Feb 27, 2016

    @omairvaiyani
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions