Cannot find module 'express' while running nodemon. Throw error, app crashed - node.js

I just created a project "project2" using "create new project : express --view=ejs project2" on a directory where I'd previously installed nodemon.
But when I typed "nodemon" on the terminal, the error says:
I installed http-errors too, but the error message persists.
What should I do to resolve this?

Try running npm install inside the project

It worked after I installed express inside project2 using:
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.

Related

Error: Can't resolve 'react-loader-spinner/dist/loader/css/react-spinner-loader.css'

I am trying to use react-loader-spinner package in my current project Here is the package, but it shows me an error.
When I imported (import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";) in the main app.js the error showed in vs code.
I also followed the documentation nothing worked for me.
I attached the picture of the error
Here is the error
I also have the same problem as I installed the package as follows 'npm install react-loader-spinner --save'.I think there was some package version limitation. Try to install the package with the version below :
"npm install react-loader-spinner#4.0.0 --save" I presume this will resolve above error.

Cannot find module express in Yarn

I'm trying to build a react app, which is built from the ground up. I use Yarn as my package manager. Whenever I try to run my node server I'm getting the error "Module not found express". which I did install and is a part of my dependencies.
I found out that the module express is being fetched from a node_modules directory instead of the local app directory, is this the issue?
error description
The module is being fetched from here:
"C:/Users/hp/AppData/Local/Microsoft/TypeScript/4.2/node_modules/#types/express/index"
Thanks in advance :)
EDIT
NPM global screenshots

React Error: Cannot find module './common'

I've scoured the internet for an answer to this, and haven't found anything yet that works. I'm new to using React, but my friend asked for help with some CSS so I cloned his React project from github (the React app is successfully online and he can work on it locally). Repo is here: https://github.com/brandonkun5/TrueAlpha
When I ran npm start, it told me I had no module 'react-scripts', so I ran npm install react-scripts
Now, when I run npm start, I get the following message:
internal/modules/cjs/loader.js:638
throw err;
Error: Cannot find module './common'
So far, I've tried:
npm del package.json
npm del node_modules
npm install
Moving the folder into a different location
Searching the code for 'Require ('common')" and 'Require ('./common')
Updating to the last node version
and nothing has worked yet. Any ideas on what could be causing this error?
The file common.js is missing in node_modules/debug/src/common.js. I copied it from another React project of mine and run npm start in the console and then it worked. Try to copy that file from the path above to same path in this project and it should work. Second option is to run "npm install debug" and file will installed and debug folder will be updated.

error Couldn't find package "#jest/environment#^24.5.0" required by "#jest/reporters#^24.5.0" on the "npm" registry

I'm completely new to React Native and I'm following Facebook's tutorial at https://facebook.github.io/react-native/docs/getting-started using React Native CLI.
Yesterday, I've created a project successfully. Today, when I create an empty folder and run react-native init AnotherProject I get:
error Couldn't find package "#jest/environment#^24.5.0" required by "#jest/reporters#^24.5.0" on the "npm" registry.
What am I doing wrong? I'm on npm 6.7.0 and node 11.12.0.
Weird. I've ran the exact same command again, and it worked.

Error: Cannot find module 'pretty-bytes'

I am getting Error: Cannot find module 'pretty-bytes' error on my mac machine when I do yo gulp-angular.
Not able to run gulp serve after getting this error
When you have a Error: Cannot find module it means that you're trying to require a package that is not installed yet.
Open a terminal then cd in your project root. When you're in your projet root you can install the module by executing npm install pretty-bytes.
You should also consider adding it to your package.json file either in the dependencies or the devDependencies.

Resources