简体   繁体   中英

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 :(

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 install ghost

well, instead of installing the Ghost Blogging Platform, it installs 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.

I believe this might be a misconfiguration with npm sources. 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 .

My npm version is 2.5.1 and my node version is v0.13.0-pre.

Thanks for any help. :)

The Ghost blogging platform is a commercial product, not a normal Node module. 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:

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

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. 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 :(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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