superset icon indicating copy to clipboard operation
superset copied to clipboard

Cannot resolve module 'react/lib/ReactDOM'

Open TingYinHelen opened this issue 10 years ago • 10 comments

I encounter an issue. I ran command npm install then I ran npm run dev , the iterm point out error:

Cannot resolve module 'react/lib/ReactDOM' in /Users/helen/Downloads/study/superset/superset/superset/assets/node_modules/.15.3.2@react-dom

So I install react-dom again, but it still doesn't work. I found this file I changed module.exports = require('react/lib/ReactDOM'); to module.exports = require('react/lib/react'); It doesn't have error, but the page seems have no css style. Can anyone help me resolve this issue?

The error from browser is below: screen shot 2016-11-28 at 7 49 25 pm

TingYinHelen avatar Nov 28 '16 11:11 TingYinHelen

Did you run npm install while the current working directory was set in the superset/assets folder?

mistercrunch avatar Nov 28 '16 16:11 mistercrunch

@mistercrunch I did. But it still has this issue:(

TingYinHelen avatar Nov 29 '16 02:11 TingYinHelen

跟你遇到一样的问题,按照你的方法改了,但是编译的时候会卡在

running install
running bdist_egg
running egg_info
writing superset.egg-info/PKG-INFO
writing dependency_links to superset.egg-info/dependency_links.txt
writing requirements to superset.egg-info/requires.txt
writing top-level names to superset.egg-info/top_level.txt
reading manifest file 'superset.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'

研究了一两天没搞定,请教怎么解决?

2017-01-02 在ubuntu下能编译成功,上面问题是在Mac下

lstk520 avatar Jan 01 '17 14:01 lstk520

@lstk520 Same problem. Remove or rename it may help. But not sure if it will cause new problem. @TingYinHelen change module.exports = require('react/lib/ReactDOM'); to module.exports = require('react-dom');

JessicaDuan avatar Jan 19 '17 09:01 JessicaDuan

What version of node/npm are you running?

mistercrunch avatar Jan 19 '17 17:01 mistercrunch

+1

ERROR in ./~/.15.3.2@react-dom/index.js
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in /Users/eeve/working/python/airbnb/superset/superset/assets/node_modules/.15.3.2@react-dom
 @ ./~/.15.3.2@react-dom/index.js 3:17-46

env: node : v7.0.0 npm: 3.10.8

Oh, I found my react version is 15.4.2, but react-dom version is 15.3.2, in 15.4.2 no lib/ReactDOM.js,I re-installed the [email protected] version just fine,But the compilation time seems very slow

eeve avatar Mar 02 '17 03:03 eeve

after 15.4.0 React DOM implementation has been moved completely to the React DOM package. in the earlier versions react-dom package import the module from react/lib/ReactDOM. but now the module is itself inside the react-dom package ./lib/ReactDOM.

dnkodi avatar Mar 11 '17 17:03 dnkodi

@TingYinHelen As @dnkodi mentioned, React package and browser build no longer "secretly" includes React DOM, please refer to Release Note for [email protected].

image

Does it works for you?

starandtina avatar Apr 30 '17 08:04 starandtina

Find a solution:

  1. Switch using cnpm instead of npm
  2. Delete the entire node_modules directory
  3. Re-download all dependencies by cnpm

diggzhang avatar Aug 02 '17 07:08 diggzhang

That's an old issue that I'm pretty sure got resolved somehow, closing.

mistercrunch avatar Aug 02 '17 15:08 mistercrunch