栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

node.js报错:Cannot find module 'ejs'的解决办法

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

node.js报错:Cannot find module 'ejs'的解决办法

发现问题

最近同事问了一个问题,他在用node.js的时候,发现node.js报错了,错误显示:

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:WebClientwebstormSpaceday6shuoshuonode_modulesexpresslibview.js:78:30)
  at EventEmitter.render (d:WebClientwebstormSpaceday6shuoshuonode_modulesexpresslibapplication.js:569:12)
  at ServerResponse.render (d:WebClientwebstormSpaceday6shuoshuonode_modulesexpresslibresponse.js:961:7)
  at exports.showIndex (d:WebClientwebstormSpaceday6shuoshuoroutesrouter.js:7:9)
  at Layer.handle [as handle_request] (d:WebClientwebstormSpaceday6shuoshuonode_modulesexpresslibrouterlayer.js:95:5)
  at next (d:WebClientwebstormSpaceday6shuoshuonode_modulesexpresslibrouterroute.js:131:13)

后来通过查找资料,发现原因是因为:没有安装ejs模块

解决办法:

cmd进入到项目目录,安装ejs:npm install --save ejs

总结

以上就是这文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/91876.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号