首页 > 网站 > WEB开发 > 正文

Error: Cannot find module 'ejs'

2024-04-27 15:03:29
字体:
来源:转载
供稿:网友

Error: Cannot find module 'ejs'    at Function._resolveFilename (module.js:317:11)    at Function._load (module.js:262:25)    at require (module.js:346:19)    at View.templateEngine (/Users/shamoon/local/node/lib/node_modules/exPRess/lib/view/view.js:133:38)    at Function.compile (/Users/shamoon/local/node/lib/node_modules/express/lib/view.js:65:17)    at ServerResponse._render (/Users/shamoon/local/node/lib/node_modules/express/lib/view.js:414:18)    at ServerResponse.render (/Users/shamoon/local/node/lib/node_modules/express/lib/view.js:315:17)    at /Users/shamoon/Sites/soldhere.in/app.js:26:7    at callbacks (/Users/shamoon/local/node/lib/node_modules/express/lib/router/index.js:272:11)    at param (/Users/shamoon/local/node/lib/node_modules/express/lib/router/index.js:246:11)

将ejs添加到根目录下的package.json的 dependencies:

 {   "dependencies": {     "express": "^4.12.2",     "ejs": "^1.0.0"   } }

然后node运行就不会报错(最install ejs 时为 -g)


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表