1

I'm new to programming, so please be gentle.

When I use 'npm start' to view my react app in local host it won't compile. I get an error message, 'Cannot find module './cli-engine'. That was not the case until today.

I suppose this file was in node_modules until recently? How can I restore my development environment to normal without breaking anything?

Here's the full error message:

Cannot find module './cli-engine'
Require stack:
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/react-scripts/node_modules/eslint/lib/api.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/getESLint.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/linter.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/index.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/cjs.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/react-scripts/config/webpack.config.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/react-scripts/scripts/start.js

UPDATE: npm install did not fix the issue. Or rather, it did, I no longer got the error described above, but I got a different "Cannot find module" error instead. Ultimately I created a completely new react-redux app using the create-react-app command and moved my source code over. Took me 10 minutes, solved the problem like a charm.

1 Answers1

0

You can try npm install, and see if that resolves the problem.

Here is explained everything you need to know about it:
What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

Dobromir Kirov
  • 934
  • 4
  • 16