I am trying to run yarn install
in the root directory of my project. Everything worked fine until I got an error in the browser console that one of the modules cannot be found. I was building the project with no errors with yarn install
but in the browser, I kept getting the error that one of the modules cannot be found.
I have tried to synchronize
files in the IntelliJ editor, also Invalidate caches and restart
in the editor, but nothing worked, I kept building the project with yarn install
with no errors but kept getting the error in the console. After that, I ran npm install
, and ever since that I cannot run yarn install
anymore. I have tried to reinstall node
to the version 10.15.3
. Ran commands npm rebuild
and npm install
again. For npm install
I get the error:
npm WARN deprecated [email protected]: Browserslist 2 could fail on
reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: This package has been deprecated in favour of
@sinonjs/samsam
npm WARN deprecated [email protected]: This version is no
longer maintained. Please upgrade to the latest version.
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\MyUser\AppData\Roaming\npm-cache\_logs\2019-03-19T14_25_52_551Z-debug.log
And if I run yarn install
I keep getting the error:
$ cross-env NODE_ENV=production webpack --no-progress --colors
--config webpack/webpack.prod.js
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'decamelize'
How can I fix this error?
Cannot find module <require-path> Ever. If you get it, it very likely means that your application is not running with the PnP resolver, meaning that your require calls won't be able to load files from your dependencies (since the node_modules needed for the regular Node resolution won't have been generated).
To solve the "Cannot find module" error in Node. js, make sure to install the package from the error message if it's a third party package, e.g. npm i somePackage . If you get the error with a local module, make sure to point the node command to a file that exists.
To fix Cannot find module errors, install the modules properly by running a npm install command in the appropriate directory as your project's app. js or index. js file. or delete the node_modules folder and package-lock.
Delete the two folders npm and npm_cache in C:\Users\user\AppData\Roaming. Restart Windows and install Node. js. Run npm init or ( npm init --yes for default config)
Do not use two dependency management tools in the same project. You are bound to get errors. Stick to one of them. I would suggest to use yarn
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With