我在 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"
}
}
这是我正在使用的新开发笔记本电脑,因此可能是问题的一部分。
我解决了这个问题,但没有解决它。我真的需要手动编译咖啡脚本吗?
谢谢!
最佳答案
我通过在 config.json
文件中明确指定 plugin.coffee 解决了这个问题。{...other stuff..."plugins": [ "./node_modules/wintersmith-coffee/plugin.coffee" , "./node_modules/wintersmith-stylus/plugin.coffee" ],...more stuff...}
关于coffeescript - Wintersmith:错误加载插件 './node_modules/wintersmith-coffee/' 时出错:找不到模块 './plugin',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21970252/