Module not found: Can't resolve '#react-stately/collections' in Next.js app - node.js

I was working on the Next.js app. I installed the react-use package in my Next.js project!
Suddenly Next.js started throwing errors!
Then, I searched for similar errors on Stackoverflow. Some of them suggested removing node_modules and package-lock.json and trying to reinstall npm packages. I did so, but nothing seems working! Then restarted VSCode and computer, but the error was still there!
Even I tried to install that package, which is shown in error, but again it throwing an error for another package.
I am not sure why suddenly started throwing errors!
This is my package.json
I tried to update NextUI's latest version which is "#nextui-org/react": "^1.0.0-beta.9"
My current package.json file, after updating the NextUI

Try to clean the cache and delete node_modules then install it again
npm cache verify
npm cache clean --force
Delete node_modules
npm install

Related

NestJs can't find module platform-express even though it's installed in node_modules

I was following a tutorial on Udemy in order to setup a NestJS app from scratch. Upon execution using npx ts-node-dev src/main.ts I get the error [PackageLoader] No driver (HTTP) has been selected. In order to take advantage of the default driver, please, ensure to install the "#nestjs/platform-express" package ($ npm install #nestjs/platform-express).
I tried uninstalling and reinstalling #nestjs/platform-express but I still get same error.
Finally solved this issue, I had to delete the entire node_modules folder and then run npm install with the same pckage.json file.

Unable to find expo in this project - have you run yarn / npm install yet? Npm has been installed, expo directory exists

My Expo project is pretty much 9999999% errors thus far, and it finally reached its climax when it decided to throw an error I've never heard of at me:
module not found: can't resolve '../utilities/platform'
I've never seen this, and I was explicitly working in an isolated styling file when it occurred. I deleted the file and the error persisted. Seeing that it was in node_modules, I figured that deleting node_modules would be helpful. It wasn't. I deleted the node_modules and tried to run npm i --save afterwards but it kept erroring out. I restarted my computer, deleted the new node_modules, and tried to run npm i --save yet again. This time I was greeted with this:
read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but package-lock.json
was generated for lockfileVersion#2. I'll try to do my best with it!
npm ERR! Maximum call stack size exceeded
Now, I have a half(ish) completed node_modules, and whenever I try to run expo start, which I have about 700000000 times before this, it tells me this...
Unable to find expo in this project - have you run yarn / npm install yet?
Which, yes stupid I have my expo set up, and yes AGAIN, I just ran npm install about twenty-two times. So I have absolutely no idea what happened, why it happened, or how to fix whatever happened. If you can help me I will award you my first born but fair warning that might take another 20 years
Try to remove all react-native data folders from "%appdata%\Temp" and execute following commands:
cd android (if any)
gradlew clean
cd.. and remove the node_modules folder
npm cache clean --force
npm install
npm start -- --reset-cache

create-react-app command aborting installation Why?

windows 10
node v10.15.1
npm v6.8.0;
I:\>npx create-react-app newpomodoro
Creating a new React app in I:\newpomodoro.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...:"^2.2.x","topo":"1.x'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2019-03-03T17_21_57_703Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting newpomodoro/ from I:\
Done.
I installed react globaly and loacaly as well but still it was giving me same error.
Can anyBody tell me whats going wrong.
Use this command:
npm cache clean --force
I am having this same problem with npm install --save --save-exact --loglevel error react react-dom react-scripts has failed. Mine then deletes node_modules and package.json. I have asked about this here: NPX create-react-app aborting installation after vulnerabilities found
I have already tried to use npm cache clean --force but this has not solved the problem. I have also tried installing different versions of node.js to no avail.
I ran into a similar issue. I don't know if you might have been in the same boat, but the cause was a space in my path name. I often save my projects on google file stream which has a space in the name ("G:/My Drive/..."). I tried creating the app in another directory and moving the folder which ended up working out.
The command npm clean --cache won't help.
If you are facing an abort installation error in react.
The abort installation error generated because of the older node version.
you should update your node package version.
To solve, run the following command and it will solve the abort installation error.
nvm install node 12.18.0
So, update your node package to the latest one. Once you've updated your node package then create your react app as follows:
npx create-react-app <your-app-name>
The abort installation error occurred because the outdated version of your node was not supporting the create-react-app command and deleted the node_modules and package.json file
Try this, please. It solved my error and hopefully, it'll solve your error too.
The issue was in node version just update it to latest version and it work's for me!
https://nodejs.org/en/download/
here is the solution which works for me, first of all, you should update all of your dependencies
then ran the command
npm cache clean --force
after that you can use
npx create-react-app

Unable to resolve "../lib/util" from "node_modules\react-native-svg\elements\Text.js"

I did some mess with the dependencies and installed the react-native-svg again even if expo already had. So i got the error while starting my application:
Unable to resolve "../lib/util" from "node_modules\react-native-
svg\elements\Text.js"
No matter what my source code is.
I tried so far to remove and reinstall the expo-cli
npm install expo-cli --global
I tried to remove manually the node_modules folder of the npm install on my computer and from my project folder
I tried to remove completely the project folder and to recreate a new project with the same name
But now even on clean project and after expo-cli reinstall I get the error above.
I'm lost in space
I’ve discovered that if you accidentally install a dependency that already exists in Expo this is the simplest way to get things running again:
Close all terminals running Expo
Close the browser window running Expo
Clear the project you were working on from the Expo app on your device.
Delete your package-lock.json
Delete your node_modules folder
Remove the dependency/dependencies that you shouldn’t have added from your package.json
Run npm i
Restart Expo using expo start -c

npm attempting to install outdated package

Previously my company had been using node-sass v3.13.1 which is out of date and will return a 404 now. I updated it a while back to load v4.9.4. It was a pain and it kept wanting to reload 3.13.1 but eventually it worked, I forget how. Anyways, now I am on a new computer and reinstalling the npm packages using npm install and it is AGAIN searching for this v3.13.1. This stupid thing just doesn't die. Of course it fails with a 404.
Things I've done:
I confirmed that the only node-sass reference in package.json is 4.9.4.
I confirmed that the only node-sass reference in package-lock.json is 4.9.4
I ran npm cache clean --force
I double checked that my git bash is set to the correct directory when running npm install
I double checked that the correct package.json and package-lock.json are in that same directory
I ran npm install node-sass#4.9.4 and it responded saying it was loading a cached binary found at .... then it started loading node-sass#3.13.1
I'm at a loss. How do I kill this thing once and for all to never ever allow npm to try to load this stupid outdated package?
I ended up finding a solution. The problem was that I had another package gulp-sass that was out of date. I updated it to 3.0.0 in the package.json and it worked. The solution I found was here:
https://github.com/codecombat/codecombat/issues/4430

Resources