TypeError:path.join的参数必须是字符串

时间:2014-03-08 06:43:29

标签: node.js less

当我写

<link rel='stylesheet' href='/stylesheets/style.less' >
在index.ejs中

,我的浏览器工作但是没有工作没有样式显示。 我写的时候

 <link rel='stylesheet' href='/stylesheets/style.css' >  
在index.ejs中

,我的浏览器错误。错误是:

GET http://localhost:3000/stylesheets/style.css 500 (Internal Server Error) 

并在cmd中显示:

TypeError: Arguments to path.join must be strings
    at f (path.js:204:15)
    at Object.filter (native)
    at Object.exports.join (path.js:209:40)
    at Object.handle (E:\nodejsApp\jsmoudle\node_modules\less-middleware\lib\middleware.js:128:26)
    at next (E:\nodejsApp\jsmoudle\node_modules\express\node_modules\connect\lib\proto.js:193:15)
    at pass (E:\nodejsApp\jsmoudle\node_modules\express\lib\router\index.js:110:24)
    at Router._dispatch (E:\nodejsApp\jsmoudle\node_modules\express\lib\router\index.js:173:5)
    at Object.router (E:\nodejsApp\jsmoudle\node_modules\express\lib\router\index.js:33:10)
    at next (E:\nodejsApp\jsmoudle\node_modules\express\node_modules\connect\lib\proto.js:193:15)
    at Object.methodOverride [as handle] (E:\nodejsApp\jsmoudle\node_modules\express\node_modules\connect\lib\middleware\methodOverride.js:48:5)
GET /stylesheets/style.css 500 12ms
GET /javascripts/index.js 304 11ms

这是package.json

{
  "name": "application-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "3.4.8",
    "ejs": "*",
    "less-middleware": "*"
  }
}

我不知道。无法通过,.css无法通过

0 个答案:

没有答案