简体   繁体   English

运行nodemon时找不到模块“ express”。 引发错误,应用程序崩溃

[英]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.

相关问题 在 docker 容器上运行 nodejs 应用程序会给出“错误:找不到模块'/usr/src/app/nodemon'” - Running a nodejs app on a docker container gives “ Error: Cannot find module '/usr/src/app/nodemon' ” 错误:使用 docker-compose 时找不到模块“/usr/src/app/nodemon” - Error: Cannot find module '/usr/src/app/nodemon' while using docker-compose nodemon 应用程序崩溃:错误代码 - MODULE_NOT_FOUND,requiresstack:[] - nodemon app crashed : Error code- MODULE_NOT_FOUND, requirestack: [ ] nodemon 应用程序崩溃 - 并返回 ERR MODULE NOT FOUND 错误 - nodemon app crashed - and returning error that ERR MODULE NOT FOUND 重新启动时Nodemon应用程序找不到模块 - Nodemon app cannot find module when restarting Nodemon运行快递错误 - Nodemon running express error nodemon 错误:错误:找不到模块“vue” - nodemon error: Error: Cannot find module 'vue' Nodemon 在设置快速服务器时崩溃 - Nodemon crashed while setting up express server 错误:找不到模块,Nodemon 崩溃 - Error: Cannot find module, Nodemon crashes module.js:549抛出错误; 错误:找不到模块'./models/TodoListModel'Nodemon在添加模型文件时显示此错误 - module.js:549 throw err; Error: Cannot find module './models/TodoListModel' Nodemon shows this error on adding model file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM