usman abid
usman abid

Reputation: 11

Cannot install react navigation ({react native})

Cannot install react navigation, error is as below,

   F:\Test2>npm install --save react-navigation
    npm WARN @babel/[email protected] requires a peer of @babel/[email protected] but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
    npm WARN [email protected] requires a peer of react-native@^0.44.1 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'F:\Test2\node_modules\.staging\fsevents-db169078\node_modules\nopt' -> 'F:\Test2\node_modules\.staging\nopt-ec00ee2d'

    npm ERR! path F:\Test2\node_modules\hoist-non-react-statics
    npm ERR! code ENOENT
    npm ERR! errno -4058
    npm ERR! syscall rename
    npm ERR! enoent ENOENT: no such file or directory, rename 'F:\Test2\node_modules\hoist-non-react-statics' -> 'F:\Test2\node_modules\.hoist-non-react-statics.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\usman\AppData\Roaming\npm-cache\_logs\2018-09-13T04_40_04_090Z-debug.log

Any help would be appreciated

Upvotes: 1

Views: 1466

Answers (2)

prolific_plus
prolific_plus

Reputation: 21

First try

npm install -g react-navigation

Or next :

Try installing

npm install @react-navigation/native

First take a backup of all the dependencies in node modules.

Take information about package.json with this file u can able to know which dependcies are already install if require u can reinstall npm then again do npm install@react-navigation/native

Upvotes: 2

s1ro6
s1ro6

Reputation: 160

It seems the hoist-non-react-statics package is incorrect. So you could re-install it or re-install the whole node_modules.

First of all, backup your node_modules folder. This is very important! Then delete node_modules folder and re-install the npm packages with npm install.

After above operation, try installing react-navigation again.

Upvotes: 0

Related Questions