Ros*_*ssB 21 javascript dependencies typescript react-native expo
我在尝试在现有的博览会项目中使用 Typescript 时收到错误。
\n在遵循文档时,我在项目根目录中创建了一个tsconfig.json文件。
\n运行时expo start
,系统会提示我安装打字稿依赖项。但是,成功安装这些后(控制台中出现勾选消息:)\xe2\x88\x9a Installed typescript@~4.3.5, @types/react@~17.0.21, @types/react-native@~0.67.6
,我收到以下错误:
It looks like you\'re trying to use TypeScript but don\'t have the required dependencies installed.\n\nPlease install @types/react by running:\n\nyarn add --dev @types/react@~17.0.21\n\nIf you\'re not using TypeScript, please remove the TypeScript files from your project and delete the tsconfig.json.\n\nerror Command failed with exit code 1.
Run Code Online (Sandbox Code Playgroud)\r\n按照说明并运行yarn add ....
命令后,我不断看到相同的错误消息。
我尝试删除node_modules文件夹和package-lock.json文件但无济于事。我也尝试遵循这个答案。\n任何帮助将不胜感激,谢谢。
\ntia*_*dws 12
似乎是一个错误。如果我安装@types/react
在 Expo 请求的特定版本上,它就可以工作 ( 17.0.21
)。
yarn add --dev @types/react@17.0.21
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
20008 次 |
最近记录: |