【问题标题】:Error installing SailsJS in OpenShift在 OpenShift 中安装 SailsJS 时出错
【发布时间】:2015-04-06 19:37:32
【问题描述】:
info: Starting app...


Grunt :: module.js:340
    throw err;
          ^
Error: Cannot find module '/var/lib/openshift/54a3a0ec4382ecf1130000f1/app-root/runtime/repo/node_modules/sails/node_modules/grunt-cli/bin/grunt'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)

    at startup (node.js:119:16)
    at node.js:902:3

【问题讨论】:

  • npm install -g grunt-cli ?
  • @Plato Open shift 不允许我使用 npm。它由 package.json 完成

标签: node.js gruntjs openshift sails.js


【解决方案1】:

OpenShift 需要将 grunt 单独添加到 package.json,它不包含它。

尝试在那里添加以下内容以使 grunt 正常工作:

   "dependencies": { "grunt-cli": ">=0.1.13", "grunt": "~0.4.4",

来源: https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6

【讨论】:

  • 正确的方法似乎是使用以下命令来生成行:npm install <pkg> --save 或 npm install <pkg> --save-dev stackoverflow.com/questions/9961502/…
  • npm init是第一次添加package.json,上面是编辑的。
猜你喜欢
  • 2023-03-22
  • 1970-01-01
  • 2015-08-17
  • 2023-04-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-04-06
  • 1970-01-01
相关资源
最近更新 更多