0

Can someone give me a step by step! guide to deploying all the work at https://github.com/Autodesk-Forge/forge-rcdb.nodejs - to Heroku or Digital Ocean? I'm fine with either, but I'd like a proper guide here for anyone else that tries to go through this.

Explanation:

Following the guide here @ Building Autodesk Forge RCDB on Windows 10 fails with node-gyp errors - I created my own DB on my localhost. I had no choice but to change the dynamic clientsecret and clientid in development.config.js to a static option - using the ones in my own forge api get it working.

Issues: https://devcenter.heroku.com/articles/nodejs-support#customizing-the-build-process

  1. Log In: I get the following error if I click on login to my forge account from the website (LINK)
  2. I've moved all of my files to heroku, hosted my database (though have not even gotten to the point of testing that far). When I try to build on heroku I get the following error.

-----> Node.js app detected -----> Build failed

  Two different lockfiles found: package-lock.json and yarn.lock

   Both npm and yarn have created lockfiles for this application,

   but only one can be used to install dependencies. Installing

   dependencies using the wrong package manager can result in missing

   packages or subtle bugs in production.

   - To use npm to install your application's dependencies please delete

     the yarn.lock file.

     $ git rm yarn.lock

   - To use yarn to install your application's dependences please delete

     the package-lock.json file.

     $ git rm package-lock.json



   https://kb.heroku.com/why-is-my-node-js-build-failing-because-of-conflicting-lock-files

 Push rejected, failed to compile Node.js app.

 Push failed
Salri
  • 3
  • 4

1 Answers1

0

Log In: I get the following error if I click on login to my forge account from the website (LINK)

You need to configure the following environment variables on Heroku (the lack of FORGE_CLIENT_ID as the environment variable was what caused the error):

"NODE_ENV": {
      "description": "Environment, defaulted to production",
      "value": "production"
    },
    "NPM_CONFIG_PRODUCTION": {
      "description": "This forces Heroku to install devDependencies, needed to build the App. Must be false!",
      "value": "false"
    },
    "FORGE_CLIENT_ID": {
      "description": "Your Forge Client ID API Key"
    },
    "FORGE_CLIENT_SECRET": {
      "description": "Your Forge Client Secret API Key"
    },
    "RCDB_DBHOST": {
      "description": "Database host url"
    },
    "RCDB_PORT": {
      "description": "Database port"
    },
    "RCDB_DBNAME": {
      "description": "Database name"
    },
    "RCDB_USER": {
      "description": "Database username"
    },
    "RCDB_PASS": {
      "description": "Database user password"
    }

This should have been easier with the Deploy to Heroku button in the project README but it's not set up right unfortunately.

I've moved all of my files to heroku, hosted my database (though have not even gotten to the point of testing that far). When I try to build on heroku I get the following error.

As is suggested in the error messages only one package manager should be present so either delete the yarn.lock or package-lock.json file in the root directory of the project and deploy again.

Bryan Huang
  • 5,247
  • 2
  • 15
  • 20