Error: Cannot find module 'ejs'

后端 未结 29 2051
南方客
南方客 2020-12-13 05:33

Here is my complete error:

Error: Cannot find module \'ejs\'
    at Function._resolveFilename (module.js:317:11)
    at Function._load (module.js:262:25)
            


        
29条回答
  •  温柔的废话
    2020-12-13 05:56

    I my case, I just added ejs manually in package.json:

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

    And run npm install (may be you need run it with sudo) Please note, that ejs looks views directory by default

提交回复
热议问题