Wintersmith: error Error loading plugin './node_modules/wintersmith-coffee/': Cannot find module './plugin'

StackOverflow https://stackoverflow.com/questions/21970252

  •  15-10-2022
  •  | 
  •  

Question

I built a site with wintersmith in November of 2013. It's live at http://powma.com

I'm coming back to it, but it's not building :-{

I don't mind getting my hands dirty, but I don't know where to start. I'm getting this error:

error Error loading plugin './node_modules/wintersmith-coffee/': Cannot find module './plugin'

Any suggestions?

Thanks!

Mike

UPDATE

Hey, this is because the coffeescript wasn't getting compiled.

I installed it globally, but that didn't help.

$ sudo npm install -g coffee-script

I manually compiled it and moved to other errors. Any suggestions for what's missing?

$ coffee -c plugin.coffee 

Here's my config.json:

{
  "locals":
    { "url": "http://localhost:8080"
    , "title": "Powma"
    , "subTitle": "Linking you to technology"
    , "motto": "We build exceptions sites and applications to connect people to products, services, and each other."
    , "owner": "Michael Cole"
    , "profilePicture": "/static/img/profile-professional.jpg"
    , "inlineSpriteMaxBytes" : 10000
    },
  "views": "./views",
  "plugins":
    [ "./node_modules/wintersmith-coffee/"
    , "./node_modules/wintersmith-stylus/"
    ],
  "require": {
    "moment": "moment",
    "_": "underscore",
    "typogr": "typogr"
  },
  "jade": {
    "pretty": true
  },
  "markdown": {
    "smartLists": true,
    "smartypants": true
  },
  "paginator": {
    "perPage": 3
  }
}

And package.json:

{
  "name": "Powma-com",
  "version": "0.1.1",
  "private": true,
  "engines": {
    "node": "0.10.17"
  },
  "dependencies": {
    "moment": "2.0.x",
    "underscore": "1.5.x",
    "typogr": "0.5.x",
    "wintersmith": "2.0.x",
    "wintersmith-stylus": "git://github.com/MichaelJCole/wintersmith-stylus.git#master",
    "wintersmith-coffee": "0.2.x",
    "express": "3.4.x",
    "sendgrid": "~0.3.0-rc.1.7",
    "express-validator": "~0.8.0",
    "underscore-express": "0.0.4"
  }
}

This is a new dev laptop I'm working with so that may be part of the problem.

I worked around the issue, but didn't fix it. Do I really need to manually compile the coffeescript?

Thanks!

Was it helpful?

Solution

I solved this issue by explicitly specifying plugin.coffee in the config.json file.

{ ...other stuff... "plugins": [ "./node_modules/wintersmith-coffee/plugin.coffee" , "./node_modules/wintersmith-stylus/plugin.coffee" ], ...more stuff... }

OTHER TIPS

It looks like you're missing wintersmith-coffee in node_modules; make sure you have it installed locally with npm install wintersmith-coffee. You can also try removing it from config.json if you're not using it anywhere.

It would also be helpful to see both your config.json and package.json. Also make sure you run an npm install and npm update to make sure you have everything referenced in package.json installed and updated.

Update

Not having CoffeeScript installed could have been the issue. After installing that globally, I'm not sure if all of your shell sessions will pick up the command and use it without being restarted. With a new shell session, see if you can build the site. You can also try testing Wintersmith in isolation of your site. Try generating a sample site with wintersmith new somepath and see if you can run wintersmith build there. That would be a good start for narrowing down your issues between your site and your workstation setup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top