Node.js' npm 安装了错误的包

Node.js' npm is installing the wrong package

很抱歉没有将 link 发布到我引用的所有内容中,Whosebug 不允许我:(

这是一个比较离奇的错误。我正在尝试通过 npm 在我的 nodejs 项目中安装 Ghost 博客平台,命令是

npm install ghost

嗯,不是安装 Ghost 博客平台,而是安装 this。这根本没有意义。 我提到的 link 来自节点模块网站。在那里,它说我使用的命令应该安装这个 ecto/ghost 东西,它 links 都用我不小心安装的 Ghost 代码安装到 git 存储库,并且我想安装的 Ghost 博客平台的 npm 页面。

我认为这可能是 npm 源配置错误。我正在使用 Arch Linux 并且我已经通过 git 克隆源代码并编译它安装了节点和 npm,如 this gist.

所示

我的npm版本是2.5.1,node版本是v0.13.0-pre。

感谢您的帮助。 :)

Ghost 博客平台是一个商业产品,不是一个普通的Node 模块。您必须在他们的网站上填写表格才能免费试用,他们会告诉您如何安装。他们让你如何使用它取决于他们。

请参考他们的文档以将其用作 NPM 模块:

https://github.com/TryGhost/Ghost/wiki/Using-Ghost-as-an-npm-module

Using Ghost as an npm module

Include Ghost as a dependency in your package.json file

"dependencies": {
  "ghost": "0.5.2"
}
Run npm install to install Ghost.

Include the Ghost module where desired and then invoke it to get a promise for a ghostServer object.

var ghost = require('ghost');
ghost().then(function (ghostServer) {
    ghostServer.start();
});
At this point Ghost should be running!

快速检查会发现这些安装命令

wget -qO ~/ghost.zip http://ghost.org/zip/ghost-latest.zip
unzip -qo ~/ghost.zip -d ~/ghost
npm install forever -g
cd ~/ghost
npm install --production

根据Ghost Blogging site

仅供下一个可能发现此问题的人使用。 我真的不知道发生了什么事。我通过以各种不同的方式卸载并重新安装节点和 npm 解决了这个问题。现在它工作正常。 当时我真的很累,尝试了很多次,所以我真的不记得任何细节了。对不起:(