【发布时间】:2015-10-06 20:22:53
【问题描述】:
我已经为此工作了几个小时,但没有运气。我刚刚将Ghost 0.7.0 下载到我的本地计算机上,并且开箱即用,npm start 运行良好。当我尝试安装我的第一个软件包时遇到了错误。我正在安装的软件包是ghost-s3-storage。但是,在部署到 heroku 时,所有包都返回类似的错误。
这是我的步骤...
$ npm start
-> works
$ npm install --save ghost-s3-storage
$ npm start
-> still works
所以现在我的package.json 包含准确的依赖关系,所以 Heroku 应该正确部署,但它没有。这似乎是由 Heroku 运行的三个命令引起的(根据他们的guide)。当我在本地运行命令时,我可以复制错误。
$ rm -rf node_modules
$ npm install --quiet --production
$ npm start
-> ERROR: Ghost is unable to start due to missing dependencies:
Cannot find module 'ghost-s3-storage'
此时,我的package.json 看起来是正确的。
package.json
"dependencies": {
...,
"ghost-s3-storage": "^0.2.2",
...,
}
但是,node_modules 中缺少 ghost-s3-storage。
$ npm ls
-> UNMET DEPENDENCY ghost-s3-storage@^0.2.2
-> npm ERR! missing: ghost-s3-storage@^0.2.2, required by ghost@0.7.0
所以我很难过。 Heroku 或者 node.js 或者我是愚蠢的。请帮忙。
【问题讨论】:
-
你解决了吗?有同样的问题。
-
我不是。联系了我的朋友和 Heroku
-
我用 npm shrinkwrap 为我工作了
-
如果你在 heroku 上设置了一个 ghost 实例,请查看:github.com/cobyism/ghost-on-heroku 它还有一个完整的 config.js