nodejs报错:Cannot find module 'ejs'
2016-05-21 14:15
423 查看
错误显示:
Error: Cannot find module 'ejs'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at new View (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\view.js:78:30)
at EventEmitter.render (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\application.js:569:12)
at ServerResponse.render (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\response.js:961:7)
at exports.showIndex (d:\WebClient\webstormSpace\day6shuoshuo\routes\router.js:7:9)
at Layer.handle [as handle_request] (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\router\layer.js:95:5)
at next (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\router\route.js:131:13)
原因:没有安装ejs模块
解决办法:
cmd进入到项目目录,安装ejs:npm install --save ejs
Error: Cannot find module 'ejs'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at new View (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\view.js:78:30)
at EventEmitter.render (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\application.js:569:12)
at ServerResponse.render (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\response.js:961:7)
at exports.showIndex (d:\WebClient\webstormSpace\day6shuoshuo\routes\router.js:7:9)
at Layer.handle [as handle_request] (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\router\layer.js:95:5)
at next (d:\WebClient\webstormSpace\day6shuoshuo\node_modules\express\lib\router\route.js:131:13)
原因:没有安装ejs模块
解决办法:
cmd进入到项目目录,安装ejs:npm install --save ejs
相关文章推荐
- Node.js 事件循环
- Nodejs中的异步编程类库Async
- Node.js系列02
- nodejs 退出命令行
- Node.js 系列01
- 使用phpstorm调试node.js代码
- 使用Node.js+Socket.IO搭建WebSocket实时应用
- How to Upgrade Node.js via NPM
- 文件和目录属性
- Node-Webkit打包
- 在node中使用babel6的一些简单分享
- 237. Delete Node in a (Linked List)
- 基于Node.js的JavaScript项目构建工具gulp的使用教程
- NodeJS 事件系统详解
- 几个node项目实例-《转载》
- nodejs初级学习(二)--nodejs+express搭建WEB工程
- nodejs的安装与配置
- nodejs中流(stream)的理解
- Node之XML
- nodeJS基础---->nodeJS的使用(一)