Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

NPM install looks for package.json - none present #94

Closed
motleydev opened this Issue Mar 26, 2013 · 3 comments

Comments

Projects
None yet
2 participants

Whenever I run npm install It crashes with looking for package.json

Owner

jnordberg commented Mar 26, 2013

Umm, where exactly are you trying to run npm install?

Also give this a read: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Sorry - I guess that was 'less than descriptive.'

I generated an app with 'wintersmith new test'
I added a plugin (tried several, problem is independent of the plugin) to the config.json like so:

{
  "locals": {
    "url": "http://localhost:8080",
    "name": "The Wintersmith's blog",
    "owner": "The Wintersmith",
    "description": "-32°C ain't no problems!",
    "index_articles": 3
  },
  "plugins": [
    "./node_modules/wintersmith-coffee/"
  ]
}

When I tried to run 'wintersmith preview' it says that it cannot find node_modules/wintersmith-coffee in the test dir. So that's when I tried running npm install which is what I thought installed that module locally.

I am new to node so I could be just missing something obvious here.

Thanks.

Owner

jnordberg commented Mar 26, 2013

The problem is that a wintersmith site is not a npm package, if you want to manage your plugins with npm you can either install them globally using npm install -g <module> or create a npm package for your site.

All that is needed for an npm package is a package.json file, looking something like this:

{
  "name": "my-wintersmith-site",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "wintersmith-coffee": "*"
  }
}

I'm will add some more example sites in the future showing how you can manage plugins.

Hope this helps,
Cheers

@jnordberg jnordberg closed this Mar 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment