Keystone.js 由于缺少导入程序,应用程序在 Heroku 上启动失败?
Keystone.js app startup fails on Heroku due to missing importer?
我的 Keystone.js 4 使用 Node 10.15 的项目无法在 Heroku 上启动:
Error: Cannot find module './lib/core/importer'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/app/node_modules/keystone/index.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Process exited with status 1
State changed from crashed to starting
Starting process with command `node ./dist/keystone.js`
State changed from starting to crashed
Process exited with status 1
internal/modules/cjs/loader.js:583
throw err;
我以与 运行 完全相同的方式正确配置了其他 Keystone 应用程序。
我已经尝试禁用构建缓存,创建一个新的应用程序实例进行部署,并通过 Heroku 控制台验证源中确实存在有问题的文件。
该项目在本地 Windows 10 和 *nix 环境中正确构建和 运行s。
我该如何调试?
看来问题是由于 npm 6.5.x 没有安装 Keystone 的所有依赖项。切换到 Yarn 作为包管理器解决了这个问题。
- 我现在安装了最新版本的 Yarn,1.13.0。
- 通过
yarn
安装依赖项
- 提交了 yarn.lock 文件
- 在我的 package.json 的 "engines" 部分指定
"yarn": "1.13.0"
并从引擎中删除 "npm"。
- 重新部署到 Heroku,它按预期工作。
希望这对某人有所帮助!
我的 Keystone.js 4 使用 Node 10.15 的项目无法在 Heroku 上启动:
Error: Cannot find module './lib/core/importer'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/app/node_modules/keystone/index.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Process exited with status 1
State changed from crashed to starting
Starting process with command `node ./dist/keystone.js`
State changed from starting to crashed
Process exited with status 1
internal/modules/cjs/loader.js:583
throw err;
我以与 运行 完全相同的方式正确配置了其他 Keystone 应用程序。
我已经尝试禁用构建缓存,创建一个新的应用程序实例进行部署,并通过 Heroku 控制台验证源中确实存在有问题的文件。
该项目在本地 Windows 10 和 *nix 环境中正确构建和 运行s。
我该如何调试?
看来问题是由于 npm 6.5.x 没有安装 Keystone 的所有依赖项。切换到 Yarn 作为包管理器解决了这个问题。
- 我现在安装了最新版本的 Yarn,1.13.0。
- 通过
yarn
安装依赖项
- 提交了 yarn.lock 文件
- 在我的 package.json 的 "engines" 部分指定
"yarn": "1.13.0"
并从引擎中删除 "npm"。 - 重新部署到 Heroku,它按预期工作。
希望这对某人有所帮助!