首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React Starter Kit错误

React Starter Kit错误
EN

Stack Overflow用户
提问于 2017-11-08 03:53:30
回答 1查看 113关注 0票数 1

我使用初学者工具包https://github.com/Microsoft/TypeScript-React-Starter#typescript-react-starter创建了一个新的React TypeScript应用程序

按照说明操作后,我在尝试为应用程序提供服务时遇到了以下错误(例如,在我运行npm run start之后)

代码语言:javascript
复制
Failed to compile.
C:\*****\node_modules\@types\react-dom\index.d.ts (16,43): error TS2305: Module '"C:/****/node_modules/@types/react/index"' has no exported member 'ReactPortal'.

我刚接触React (对Node和NPM略知一二),我不了解no exported member方面?

帮助。

EN

回答 1

Stack Overflow用户

发布于 2017-11-08 03:53:30

我想通了。在用于构建节点模块的初始package.json文件中,"devDependencies"密钥下的"@types/react": <version>"dependencies"密钥下的版本不同。确保这些版本是一致的。

对我来说,"dependencies"下的版本是"^16.0.0",所以我把"devDependencies"下的版本改为"^16.0.0"

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47166365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档