有人可以给我分步!指南,将https://github.com/Autodesk-Forge/forge-rcdb.nodejs上的所有工作部署到Heroku或Digital Ocean吗?我对这两者都很好,但是我想在这里给所有尝试通过此指南的人一个适当的指南。
说明:
按照此处的指南@ Building Autodesk Forge RCDB on Windows 10 fails with node-gyp errors-我在本地主机上创建了自己的数据库。我别无选择,只能将development.config.js中的动态clientsecret和clientid更改为静态选项-使用我自己的伪造api中的选项使它正常工作。
问题: https://devcenter.heroku.com/articles/nodejs-support#customizing-the-build-process
----->检测到Node.js应用 ----->构建失败
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
答案 0 :(得分:0)
登录:如果我从网站(LINK)单击登录到我的伪造帐户,则会出现以下错误
您需要配置以下environment variables on Heroku(缺少FORGE_CLIENT_ID
的原因是导致错误的环境变量):
"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"
}
使用项目自述文件中的Deploy to Heroku
按钮,本来应该更容易,但是不幸的是,它的设置并不正确。
我已将所有文件移至heroku,托管了数据库(尽管到目前为止还没有达到测试的目的)。当我尝试在heroku上构建时,出现以下错误。
如错误消息中所建议,仅应存在一个软件包管理器,因此请删除项目根目录中的yarn.lock
或package-lock.json
文件,然后再次部署。