3

我在 2013 年 11 月与 Wintersmith 建立了一个网站。它在http://powma.com上直播

我回来了,但它没有建立:-{

我不介意弄脏我的手,但我不知道从哪里开始。我收到此错误:

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

有什么建议么?

谢谢!

麦克风

更新

嘿,这是因为咖啡脚本没有被编译。

我在全球范围内安装了它,但这没有帮助。

$ sudo npm install -g coffee-script

我手动编译它并移动到其他错误。对于缺少的内容有什么建议吗?

$ coffee -c plugin.coffee 

这是我的 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
  }
}

和 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"
  }
}

这是我正在使用的新开发笔记本电脑,因此这可能是问题的一部分。

我解决了这个问题,但没有解决它。我真的需要手动编译咖啡脚本吗?

谢谢!

4

2 回答 2

2

看起来您在 node_modules 中缺少 Wintersmith-coffee;确保您已使用npm install wintersmith-coffee. config.json如果您不在任何地方使用它,您也可以尝试将其删除。

查看您的config.jsonpackage.json. 还要确保您运行npm installnpm update确保您已package.json安装和更新中引用的所有内容。

更新

没有安装 CoffeeScript 可能是问题所在。在全局安装之后,我不确定您的所有 shell 会话是否都会选择该命令并在不重新启动的情况下使用它。使用新的 shell 会话,看看您是否可以构建站点。您也可以尝试隔离您的站点来测试 Wintersmith。尝试生成一个示例站点,wintersmith new somepath看看是否可以在wintersmith build那里运行。这将是缩小站点和工作站设置之间的问题的良好开端。

于 2014-02-24T10:15:29.533 回答
2

config.json我通过在文件中明确指定 plugin.coffee 解决了这个问题。

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

于 2014-04-02T21:02:51.707 回答