nodejs报错:Cannot find module 'ejs'
2018-01-24 15:21
295 查看
错误显示:
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
相关文章推荐
- nodejs报错:Cannot find module 'ejs'
- nodejs报错:Cannot find module 'ejs'
- nodeJs启动的时候:Error: Cannot find module '../build/Release/bson'的解决办法
- nodejs中cannot find node module
- Error: Cannot find module 'ejs'
- nodeJs启动的时候:Error: Cannot find module '../build/Release/bson'的解决办法
- 安装了nodejs后在命令行运行npm报错:Error: Cannot find module 'internal/util/types'
- [乐意黎]Nodejs采集程序抛Error: Cannot find module 'superagent' 及 Cannot find module 'superagent' 等的解决方法
- node.js报错:Cannot find module 'ejs'的解决办法
- 在Linux下安装nodejs遇到Cannot find module 'npmlog'问题的解决方法
- NodeJS:cannot find module 'socket.io' | nmp全局安装 modules 后在应用中 require 不到的解决方案
- 【NodeJS】Error: Cannot find module 'ms'
- ionic Cannot find module 'config-chain'
- “Cannot find module 'webpack/lib/node/NodeTemplatePlugin”问题
- Node.js node主文件找不到时报出的Error:Cannot find module异常
- 解决Cannot find module ‘meteor/meteor’ ‘meteor/check’ ‘meteor/mongo’
- 关于新版本react-native报错 :Cannot find module 'invariant'
- PHP下解决Cannot find module (IP-MIB)的问题
- nodejs express 启动报错:Error: Cannot find module 'xxx'
- git bash下出现错误Error: Cannot find module 'git目录/node_modules/git包/bin/git包'