简体   繁体   English

Node.js的npm安装了错误的软件包

[英]Node.js' npm is installing the wrong package

I'm sorry for not posting the links to every thing I've quoted, stackoverflow won't let me :( 很抱歉没有发布我引用的所有内容的链接,stackoverflow不会让我:(

This a relatively bizarre error. 这是一个相对奇怪的错误。 I am trying to install the Ghost Blogging Platform in my nodejs project through npm, and the command for that is 我正在尝试通过npm在我的nodejs项目中安装Ghost Blogging Platform,该命令是

npm install ghost

well, instead of installing the Ghost Blogging Platform, it installs this . 好吧,它不会安装Ghost Blogging Platform,而是安装了this Which makes no sense at all. 这根本没有道理。 The link I've reffered to is from a node modules website. 我引用的链接来自节点模块网站。 There, it says that the command I've used was supposed to install this ecto/ghost thing and it links both to the git repository with the Ghost code I've accidentally installed and to the npm page for the Ghost Blogging Platform, which I wanted to install. 在那里,它说我使用的命令应该是要安装此ecto / ghost的东西,它既链接到具有我意外安装的Ghost代码的git存储库,又链接到Ghost Blogging Platform的npm页面。想安装。

I believe this might be a misconfiguration with npm sources. 我相信这可能是npm源的错误配置。 I'm using an Arch Linux and I've installed both node and npm via git clonning the source and compiling it, as seen on this gist . 我正在使用Arch Linux,并且通过git克隆了源代码并对其进行了编译,同时安装了node和npm,如本要点所示

My npm version is 2.5.1 and my node version is v0.13.0-pre. 我的npm版本是2.5.1,节点版本是v0.13.0-pre。

Thanks for any help. 谢谢你的帮助。 :) :)

The Ghost blogging platform is a commercial product, not a normal Node module. Ghost博客平台是一种商业产品,而不是普通的Node模块。 You have to fill out the forms on their site for a free trial, and they'll tell you how to install it. 您必须在其网站上填写表格以免费试用,然后他们会告诉您如何安装。 How log they let you use it for is up to them. 他们如何让您使用它的日志取决于他们。

Please reference their documentation for using it as an NPM Module: 请参考他们的文档以将其用作NPM模块:

https://github.com/TryGhost/Ghost/wiki/Using-Ghost-as-an-npm-module 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!

A quick check reveals these install commands 快速检查发现这些安装命令

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

as per Ghost Blogging site 根据Ghost Blogging网站

just for the next guy who might find this problem. 仅针对可能会发现此问题的下一个家伙。 I really don't know what happened. 我真的不知道发生了什么 I solved the problem by uninstalling and reinstalling node and npm in various different ways. 我通过以各种不同方式卸载并重新安装node和npm解决了该问题。 Now it works fine. 现在工作正常。 I was really tired by the time and had tried a lot of times so I really don't remember any details. 那时我真的很累,尝试了很多次,所以我真的不记得任何细节了。 Sorry :( 对不起:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM