首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wintersmith:错误加载插件‘/节点_模块/温特史密斯咖啡/:找不到模块'./ plugin’

Wintersmith:错误加载插件‘/节点_模块/温特史密斯咖啡/:找不到模块'./ plugin’
EN

Stack Overflow用户
提问于 2014-02-23 15:30:41
回答 2查看 595关注 0票数 3

2013年11月,我和温特史密斯建立了一个网站。在http://powma.com现场直播

我要回去了,但它不是在建造

我不介意弄脏我的手,但我不知道从哪里开始。我得到了一个错误:

代码语言:javascript
复制
error Error loading plugin './node_modules/wintersmith-coffee/': Cannot find module './plugin'

有什么建议吗?

谢谢!

麦克

更新

嘿,这是因为coffeescript没有被编译。

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

代码语言:javascript
复制
$ sudo npm install -g coffee-script

我手动编译了它,并移到其他错误。有什么建议吗?

代码语言:javascript
复制
$ coffee -c plugin.coffee 

这是我的config.json:

代码语言:javascript
复制
{
  "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:

代码语言:javascript
复制
{
  "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"
  }
}

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

我解决了这个问题,但没有解决。我真的需要手动编译coffeescript吗?

谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-04-02 21:02:51

我通过在plugin.coffee文件中显式指定config.json来解决这个问题。

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

票数 2
EN

Stack Overflow用户

发布于 2014-02-24 10:15:29

看起来你缺少了node_modules中的温特史密斯咖啡;确保它与npm install wintersmith-coffee一起安装在本地。如果您不在任何地方使用它,也可以尝试从config.json中删除它。

同时看到您的config.jsonpackage.json也很有帮助。还要确保运行npm installnpm update,以确保安装和更新了package.json中引用的所有内容。

更新

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21970252

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档