npm install react-navigation-stack@^1.10.3 gives error

641 Views Asked by At

I installed react-navigation v4 and now I want to install react-navigation-stack@^1.10.3

So I ran npm install react-navigation-stack@^1.10.3 and this is the message I got:

npm WARN deprecated [email protected]: This version of React Navigation Stack is no longer supported. Please upgrade to 2.x.x. See https://reactnavigation.org/docs/4.x/upgrading-from-3.x#react-navigation-stack for instructions. 
npm WARN [email protected] requires a peer of react-native-screens@^1.0.0 || ^1.0.0-alpha but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\file-uri-to-path):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'C:\Users\yaelp\Downloads\meals-cat\node_modules\file-uri-to-path' -> 'C:\Users\yaelp\Downloads\meals-cat\node_modules\.file-uri-to-path.DELETE'        
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\nan):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'C:\Users\yaelp\Downloads\meals-cat\node_modules\nan' -> 'C:\Users\yaelp\Downloads\meals-cat\node_modules\.nan.DELETE'

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\yaelp\Downloads\meals-cat\node_modules\react-navigation-stack
npm ERR! dest C:\Users\yaelp\Downloads\meals-cat\node_modules\.react-navigation-stack.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\yaelp\Downloads\meals-cat\node_modules\react-navigation-stack' -> 'C:\Users\yaelp\Downloads\meals-cat\node_modules\.react-navigation-stack.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\yaelp\AppData\Roaming\npm-cache\_logs\2020-10-02T15_41_49_774Z-debug.log
1

There are 1 best solutions below

2
On

Try upgrading your react-navigation-stack version to 2.x.x, as it says in the first message:

This version of React Navigation Stack is no longer supported. Please upgrade to 2.x.x. See https://reactnavigation.org/docs/4.x/upgrading-from-3.x#react-navigation-stack for instructions.

Or try installing it like that:

npm install [email protected]

I wouldn't recommend you installing deprecated libraries even if you really want to, because usually there is a big reason behind when some package version goes deprecated.

From the link above:

Note: The alpha versions for 2.0 used Reanimated for the animations. We've replaced Reanimated with React Native's Animated API in the stable release. If you did any custom animations with the alpha, please migrate your code to the Animated API.