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

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

Related

React Typescript: It looks like you're trying to use TypeScript but do not have typescript installed

I want to create a React application and I want to use a typescript in this application, at first I went to the React website in order to create an application using typescript and I found that I had to put this instruction in the terminal first:
npx create-react-app my-app --template typescript
And when it finished installing, I put it in the terminal:
npm start
But I got this error:
It looks like you're trying to use TypeScript but do not have typescript installed
I opened the terminal and wrote this instruction:
npm install
then i run the app:
npm start
But the error is still there
How can I solve the problem?
I solved my problem with the following instruction:
npm install --save typescript #types/node #types/react #types/react-dom #types/jest
or
yarn add typescript #types/node #types/react #types/react-dom #types/jest
have you tried
npm install -g typescript
yes i tryed but still with error
Have you tried
npm run start
Consider upgrading Next.js 11 to 12 or to latest version. Also, you need to upgrade types to latest for react and react-dom. Here is a brief documentation about that:
https://nextjs.org/docs/upgrading#upgrade-nextjs-version-to-12

Cannot find module 'react-dom/test-utils' from 'act-compat.js'

I cannot seem to resolve why I'm receiving this error: Here are my configs:
lang-js
react - 15.3.1
react-dom - 15.3.1
react-testing-library - 6.0.0
jest - 23.6.0
lang-js
import React from 'react';
import { render, fireEvent, cleanup } from 'react-testing-library';
afterEach(cleanup);
test('loads and displays ', async() => {
})
I commented on an open GH issue on the react-testing-library page. Thanks in advance
This may have happened if something got modified or deleted in your react-dom dependency package.
Using yarn
You can verify that already installed files in node_modules did not get removed, reinstalling any missing files by using:
npm install --check-files
That should help you restore react-dom to what it should be.
If that doesn't work, you can always try to completely remove and reinstall all of your packages. From your project root folder, try:
rm -rf node_modules
yarn install
Using npm
First, you can try just to install react-dom again. That might solve your problem:
npm install react-dom
If that doesn't work, then you can try to reinstall all of your packages to get a fresh copy.
From your project root folder, try:
rm -rf node_modules
npm install

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

Can't resolve radium

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'

Creating the react app issue with npm

I tried creating the new react app and for that i have followed the reactjs command to install like npm install -g create-react-app. But its not working and i am getting the error as npm ERR! Cannot find module 'pseudomap'. So for that i have uninstalled the nodejs 3 times and installed freshly. But still no luck for me. Can anybody provide any solution for this.
See below screens:

Resources