首页 文章

npm安装上的React Navigation Error

提问于
浏览
1

我正在尝试使用反应导航创建一个新的反应本机应用程序 .

我做了以下事情:

1.)create-react-native-app myAppName

2.)cd myAppName /

3.)npm install --save react-navigation

4.)期望成功安装反应导航,但我得到:

C:\Users\Maima\Documents\GitHub\React\test>npm install --save react-navigation
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\jest.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
est\node_modules\jest
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\jest as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
node_modules\jest
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\rimraf.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
\test\node_modules\rimraf
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\rimraf as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
t\node_modules\rimraf
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\uuid.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\t
est\node_modules\uuid
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\uuid as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\test\
node_modules\uuid
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\semver.cmd as it wasn't installed by C:\Users\Maima\Documents\GitHub\React
\test\node_modules\semver
npm WARN rm not removing C:\Users\Maima\Documents\GitHub\React\test\node_modules
\.bin\semver as it wasn't installed by C:\Users\Maima\Documents\GitHub\React\tes
t\node_modules\semver
npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN react-navigation@1.0.0-beta.23 requires a peer of react@* but none is i
nstalled. You must install peer dependencies yourself.
npm WARN react-navigation@1.0.0-beta.23 requires a peer of react-native@* but no
ne is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.74 requires a peer of react@* but none is ins
talled. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.74 requires a peer of react-native@* but none
 is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout-polyfill@1.3.2 requires a peer of react-nati
ve@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout@1.3.2 requires a peer of react@* but none is
 installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout@1.3.2 requires a peer of react-native@* but
none is installed. You must install peer dependencies yourself.

+ react-navigation@1.0.0-beta.23
added 8 packages, removed 973 packages and updated 20 packages in 259.667s

请帮助,不能npm启动我的React Native App .

2 回答

  • 1

    我不能发表评论,因为我没有积分,所以这是暂时回答信息:

    在Windows上运行Expo时遇到了类似的问题 . 解决我不得不关闭XDE并重新安装 .

    如果这还不够,请删除“node_modules”文件夹并运行“npm install” .

  • 0

    他们没有安装't errors, just warnings telling you that some peer dependencies that navigation relies on aren' . 根据您的命令,您需要运行 npm installyarn install 来安装所有软件包 . 使用 create-react-native app创建应用程序会为您提供一个包列表,但您必须使用 npm install 实际安装它们 . 如果发生了一些时髦的事情,请按照@vbandrade的建议做一些软管你的node_modules和 package.lock ,然后做一个新的 npm install

相关问题