Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照操作步骤执行 报Module not found: Can't resolve 'react-dom' #11

Closed
zhangyucumt opened this issue Jun 3, 2020 · 2 comments
Closed

Comments

@zhangyucumt
Copy link

操作步骤

npx @ovine/init init my-app
cd ./my-app
yarn install
yarn dev

执行结果

(dinobot)  ~/Documents/code/practice/_ovine/my-app  yarn dev
yarn run v1.22.4
$ ovine dev --no-dll --mock

Starting the development server...

✖ Ovine-Dev
  Compiled with some errors in 26.85s

ℹ 「wds」: Project is running at http://localhost:7050/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/zhangyu/Documents/code/practice/_ovine/my-app
ℹ 「wds」: 404s will fallback to /index.html

url: http://localhost:7050/
env: localhost
mock: true



./node_modules/@ovine/core/lib/app/app.js
Module not found: Can't resolve 'react-dom' in '/Users/zhangyu/Documents/code/practice/_ovine/my-app/node_modules/@ovine/core/lib/app'


./node_modules/amis/lib/components/DateRangePicker.js
Module not found: Can't resolve 'react-dom' in '/Users/zhangyu/Documents/code/practice/_ovine/my-app/node_modules/amis/lib/components'


./node_modules/amis/lib/components/Select.js
Module not found: Can't resolve 'react-dom' in '/Users/zhangyu/Documents/code/practice/_ovine/my-app/node_modules/amis/lib/components'

node 的版本是 v10.15.0

@jinmingpang
Copy link
Member

jinmingpang commented Jun 4, 2020

有点尴尬,这个问题是已知问题,新版本修复了。因为加了热更新,使用了@hot-loader/react-dom新依赖包。用最新版的 @ovine/init 0.0.1-alpha.9 重新生成项目就解决了。

解决方案: 只需要重新执行。npx @ovine/init init my-app

不要用npm淘宝镜像源,因为它有可能不能及时同步最新版的npm包。切换到官方镜像 npm config set registry https://registry.npmjs.org/

对了,另外 yarn install 包都装好了,使用yarn start启动项目,会快很多。

有其他问题,欢迎反馈。这些我都会更新到文档里。现在还有集成测试的工作在弄,文档没有更新很及时。目前只有最简单的项目框架,这周会提供更加丰富的模版,更容易上手。

@zhangyucumt
Copy link
Author

可以启动了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants