Can't resolve radium - reactjs

I am new to React Environment, and was going through a tutorial and tried to install Radium for css pseudo behaviour using visual integrated terminal.
npm i --save radium
the radium has been installed and added to the package.json
but after making changes and saving compilation has been failed and throwing the following error.
Module not found: Can't resolve './../../webpack/buildin/global.js' in 'D:\maximillian-react\react-complete-guide\node_modules\radium\es'
What went wrong?
and Thanks in advance

npm install --save radium --force

Oh, It's really bad but I found what went wrong, I just installed the dependencies using
npm install
and everything is working fine.

After installing Radium stop your React development server ctrl+c and then run:
yarn start
or
npm start
If necessary, before restarting development server run:
npm install
as well and that will fix any missing dependencies.

check the syntax for your import for importing radium in respective components the correct syntax I have attached in the code snippets . please do check
import Radium from 'radium'

Related

While run the React application getting error

You need to install 'webpack-dev-server' for running 'webpack serve'.
Error: Cannot find module 'ajv/dist/compile/codegen'
I getting error like this when give npm install to run React application. Please give solution to solve this issue.
I had the same issue when I used JHipster, which I solved by running this command
npm install --save-dev ajv#^7
Thanks to this answer

Cannot use MUI 'ContentCopy' icon

I am trying to use the icon 'ContentCopy' from MUI.
https://mui.com/components/material-icons/ says to use the following import:
import ContentCopyIcon from '#mui/icons-material/ContentCopy';
No matter what I do, I get the error:
Module not found: Can't resolve '#mui/icons-material/
I have already tried the following:
npm install #material-ui/core
npm install #material-ui/icons
I also tried deleting my node-modules and re-running npm install.
Any ideas on what else I could try??
It seems that you confused of using version 4 and 5.
You need to install the icons of version 5.
npm install #mui/icons-material
And import the icon from the module.
import ContentCopyIcon from '#mui/icons-material/ContentCopy';
Please refer to this.
to version 5 you need to install mui
npm install #mui/icons-material
mui contains all the icons
from '#mui/icons-material/_';
info https://www.npmjs.com/package/#mui/icons-material

Missing package "metro" in the project at D:\ReactNative\FirstProject

Missing package "metro" in the project at D:\ReactNative\FirstProject. This usually means react-native is not installed. Please verify that dependencies in package.json include "react-native" and run yarn or npm install.
Error: Missing package "metro" in the project at D:\ReactNative\FirstProject. This usually means react-native is not installed. Please verify that dependencies in package.json include "react-native" and run yarn or npm install.
enter image description here
I had the same issue after installing
react-native-paper
After follow this steps all worked again
Remove node_modules folder.
Install all dependencies again, run npm install. If show any error Remove package-lock.json.
Run npm start again.
Happy coding.
you don't really need to delete node_modules folder.
just update it by typing:
1/ npm : npm install
or
2/ yarn : yarn install
in your terminal. That will update the node_modules folder content as well as creating all missing files without the need to reinstall it from scratch.
I deleted the folder "node_modules" then run "npm install" again. It worked for me.
I had this issue after I installed react-native-svg
Maybe there is some sort of naming conflict is causing this error? Deleting node_modules and running npm install again fixed it for me.
I was getting the same problem, after running 'npm install --global expo-cli' it solved the issue or you can run npm install
I had this issue after installing #react-native-community/hooks
You don't need to delete any node_modules folder.
Installing react-native again solved the problem for me.
npm i react-native
Try Using npm i metro
Worked for me
try to start the project from main folder created by expo init.
i.e opening the project folder directly on you visual studio
It happened to me when you tried install #react-native/bottom-tabs. But I've installed this package with npm, so I removed this package and installed it again with yarn and it fix my problem with no need to remove node_modules.
You are getting this problem based on how you created the program. So, when I created it from the terminal, following this instruction: https://reactnative.dev/docs/environment-setup it worked, but when I tried to create the program inside of the terminal in an existing project, I got the error.
installing expo and expo start working for me.
I experienced the same issue, I'm using expo managed workflow, and cleaning cache has worked for me.
expo r -c is the command I used.

Can't resolve 'react-dom' in /ButtonBase'

I'm trying to run a React project created in Mac, I had not this problem neither in Windows or Mac, but I'm facing the following errors when I try to run (npm start) in Ubuntu:
./node_modules/#material-ui/core/esm/ButtonBase/ButtonBase.js
Module not found: Can't resolve 'react-dom' in '/node_modules/#material-ui/core/esm/ButtonBase'
I tried to delete node_modules and ran npm install again, but the problem persists.
Can someone help me with this?
Just install react and react-dom
npm i react react-dom

Why do I encounter: "TypeError: t(...).isPlaceholder is not a function" when "import './bootstrap/dist/css/bootstrap.min.css'"

I installed bootstrap via npm install already and i tried to import it to my App.js file:
import './bootstrap/dist/css/bootstrap.min.css'
But then the app return this on the browser:
TypeError: t(...).isPlaceholder is not a function
Could someone please explain why and how to fix?
Thank you
For me, I saw these errors when I bumped #babel dependencies a few minor versions (several packages and plugins).
What helped was removing the node_modules directory and then installing all the packages again.
Remove node_modules: rm -rf ./node_modules
Install packages yarn or npm i
Run your project again
I just encountered this error.
To fix it, make sure you're not mixing up your package managers. I was using yarn, but then used npm because that's what we use at work.
you should add or install your modules using the same package manager
For me it works with a standard create-react-app structure via:
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
For us, it's a yarn bug related to using yarn link with a messy lockfile. The solution was to use yarn-deduplicate.
Prior to finding that fix, my workaround was
yarn link other-repo from main-repo
yarn install from main-repo
yarn install --check-files from other-repo
Which can be done using an alias

Resources