【问题标题】:Openshift - missing modules when deploying Keystone.JSOpenshift - 部署 Keystone.JS 时缺少模块
【发布时间】:2015-06-25 05:44:51
【问题描述】:

我正在尝试安装 keystone.js,但不断收到缺少模块的错误,有人可以帮忙吗?我已经更新了我的 package.json 以包含 cloud-env 依赖项,但仍然没有乐趣。可用于将 KS 部署到 Openshift 的文档很少。

Error: Cannot find module 'keystone'
 at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/var/lib/openshift/5501b0c04382ecfefe0000a2/app-root/runtime/repo/web.js:1:78)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
DEBUG: Program node web.js exited with code 8
DEBUG: Starting child process with 'node web.js'

包.json:

{
  "name": "node",
  "version": "0.0.0",
 "private": true,
 "dependencies": {
   "cloud-env": "^0.1.0",
   "keystone": "latest",
   "underscore": "latest"
  },
  "devDependencies": {
    "grunt": "~0.4.4",
    "grunt-express-server": "~0.4.17",
    "grunt-contrib-jshint": "~0.7.1",
    "grunt-contrib-compass": "^1.0.1",
    "grunt-contrib-csslint": "^0.3.1",
"grunt-contrib-cssmin": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-cssstats": "^1.0.1",
"grunt-stats": "^0.1.0",
"jshint-stylish": "~0.1.3",
"load-grunt-tasks": "~0.4.0",
"load-grunt-configs": "^0.4.1",
"grunt-node-inspector": "~0.1.5",
"time-grunt": "~0.3.1",
"grunt-concurrent": "~0.5.0",
"grunt-nodemon": "~0.2.1",
"open": "0.0.5"
   },
   "engines": {
     "node": ">=0.10.22",
   "npm": ">=1.3.14"
   },
  "scripts": {
    "start": "node web.js"
  },
    "main": "web.js"
  }

【问题讨论】:

    标签: javascript openshift node-modules keystonejs


    【解决方案1】:

    这是一个迟到的答案,但今天我遇到了同样的问题,以下对我有用:

    rhc ssh <app>
    cd $OPENSHIFT_REPO_DIR
    npm install
    

    将应用推送到 openshift 时可能出现问题。这样您就可以手动修复软件包。

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题。根据我的研究,关闭 ssh 连接的问题似乎是其他人在跨各种语言在小型 openshift 齿轮上构建时遇到的问题(我读过一些观点,它确实可以运行安装重新开中档或以上)。但是,我未能使用@barney765 的解决方案获得npm install 来完成:每次运行它时,我都会遇到类似的“连接关闭”问题。

      由于我并没有真正准备好升级到中型设备,因此我的解决方法是将我的生产 node_modules 提交到 git,因此一旦部署到 openshift 就不需要 npm install

      在提交您的 node_modules 时 does have its drawbacks - openshift 文档 出现 to suggest this is as a viable approach (read the "node_modules" heading)

      【讨论】:

        猜你喜欢
        • 2019-12-16
        • 2017-01-03
        • 2020-07-16
        • 2020-10-08
        • 1970-01-01
        • 1970-01-01
        • 2013-09-05
        • 2016-05-22
        • 1970-01-01
        相关资源
        最近更新 更多