[英]Cannot find module 'express' while running nodemon. Throw error, app crashed
I just created a project "project2" using "create new project : express --view=ejs project2" on a directory where I'd previously installed nodemon. 我刚刚在先前安装nodemon的目录上使用“创建新项目:express --view = ejs project2”创建了一个项目“ project2”。
But when I typed "nodemon" on the terminal, the error says: 但是,当我在终端上键入“ nodemon”时,错误提示:
I installed http-errors too, but the error message persists. 我也安装了http-errors,但是错误消息仍然存在。 What should I do to resolve this?
我应该怎么做才能解决这个问题?
尝试在项目中运行npm install
It worked after I installed express inside project2 using: 在我使用以下方法在project2中安装express后,它起作用了:
npm install express --save
However, there were still more error messages such as: "Could not find module 'cookie-parser'," which were all resolved by installing all the respective modules. 但是,还有更多错误消息,例如:“找不到模块'cookie-parser'”,这些错误消息都通过安装所有相应模块来解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.