Expo says react-native is missing - react-native

I installed expo using the facebook guide by running
npm install -g expo-cli
npm install react-navigation
expo start
However it still says
npm WARN #react-native-community/netinfo#2.0.10 requires a peer of react-native#>=0.57 <0.60 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps#9.4.5 requires a peer of #types/googlemaps#^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps#9.4.5 requires a peer of #types/markerclustererplus#^2.1.29 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps#9.4.5 requires a peer of #types/react#^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated#1.0.1 requires a peer of react#16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated#1.0.1 requires a peer of react-native#^0.44.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-webview#5.8.1 requires a peer of react-native#>=0.57 <0.60 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
I tried to delete my node_modules folder and rerunning npm install in the directory of my project
It still says react-native not found, although running
react-native -v
in command line, shows
react-native-cli: 2.0.1
react-native: 0.60.3

Actually you have only install expo-cli not react native cli , even if your package.json has react-native it is not accessiable from your cli . so you have to install react-native-cli seperately so that you can access react-native.
npm install –g react-native-cli

Related

How do I install jest?

Been trying to install jest with this command:
npm i --global jest
and get these messages:
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
/Users/GRW/.nvm/versions/node/v6.11.1/bin/jest -> /Users/GRW/.nvm/versions/node/v6.11.1/lib/node_modules/jest/bin/jest.js
npm WARN jsdom#16.4.0 requires a peer of canvas#^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.3.1 requires a peer of bufferutil#^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.3.1 requires a peer of utf-8-validate#^5.0.2 but none is installed. You must install peer dependencies yourself.
+ jest#26.4.2
updated 1 package in 32.731s
Have tried manually installing peer dependencies with:
npm i --save --global canvas#^2.5.0
npm i --save --global bufferutil#^4.0.1
npm i --save --global utf-8-validate#^5.0.2
but still am unable to install jest.
How do I install jest?
EDIT: Forget about the global install and the peer dependency warnings go away, but I still get:
-bash: jest: command not found
Since I seemed to have a prior installation of nvm that kept installations of different versions of node in different directories, I decided to start fresh.
Uninstalled and deleted jest, node, npm, and nvm.
Reinstalled node/npm, and was able to install jest and get the jest -v command to work properly.

Cannot find module 'webpack-cli/bin/config-yargs', cannot find module 'webpack-cli'

I have tried nearly all solutions however nothing has worked for me. i cloned a repo from a friend and tried to run the client directory. When i try run client, i get the error:
Cannot find module 'webpack-cli/bin/config-yargs'
Cannot find module 'webpack-cli'
Once i cloned the project i did npm install (as it said in the readME) but when i tried to run the client i would run into this problem:
solutions i tried:
npm install -g vue-cli
npm install --save-dev webpack
npm install --save-dev webpack-cli
i tried 'webpack --version' it will tell me i am missing something and if i want to install it. i click yes and i get the following error:
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN ajv-keywords#3.4.1 requires a peer of ajv#^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware#3.4.0 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server#3.1.11 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-cli#3.3.11 requires a peer of webpack#4.x.x but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
webpack-cli#3.3.11
updated 1 package and audited 12959 packages in 13.437s
24 packages are looking for funding
run npm fund for details
found 33 vulnerabilities (22 low, 7 moderate, 4 high)
run npm audit fix to fix them, or npm audit for details
Error: Cannot find module 'webpack-cli'
UPDATE:
My colleague updated some of the dependencies by GitHub bot and i pulled the repo. That seemed to do the trick

Tried to install react-navigation , and it says following. how can i fix these errors ? npm audit fix did not work

chamika#chamika-MS-7817:~/Documents/React Native Projects/navi$ npm install react-navigation
npm WARN #react-native-community/masked-view#0.1.5 requires a peer of react-native#^0.57 but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/eslint-plugin#2.15.0 requires a peer of #typescript-eslint/parser#^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app#5.1.0 requires a peer of #typescript-eslint/parser#2.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app#5.1.0 requires a peer of eslint#6.x but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-stack#2.0.10 requires a peer of react-native-safe-area-context#^0.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.2 (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
react-navigation#4.0.10
updated 1 package and audited 1858915 packages in 11.492s
35 packages are looking for funding
run npm fund for details
found 4 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details
These are not errors, they are just warnings that you need to install the sub-dependencies of the given package yourself. React Navigation is installed successfully in this case and you can use it fine. You can try doing npm audit fix which will try to fix these warnings by installing the dependencies.

I accidentally typo'd "npm i npm" and it installed a bunch of node modules I didn't need. How can I revert?

I'm new, and I'm lost because I think I messed up my whole program. I cannot install anymore node variations. I'm using Visual Studio Code. And after the code below I typed "npm uninstall npm" thinking it would fix it, but it seems not.
I tried npm uninstall npm and it didn't work. :/
npm WARN discord.js#11.5.0 requires a peer of bufferutil#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of erlpack#discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of libsodium-wrappers#^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of node-opus#^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of opusscript#^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of sodium#^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of #discordjs/uws#^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando#0.10.0 requires a peer of sqlite#^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN westeros-bot#1.0.0 No description
npm WARN westeros-bot#1.0.0 No repository field.
+ npm#6.9.0
added 426 packages from 800 contributors and audited 12108 packages in 45.684s
found 12 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details```
AFTER
```c:\Users\madel\Desktop\Westeros Bot\dist>npm uninstall npm
npm WARN discord.js#11.5.0 requires a peer of bufferutil#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of erlpack#discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of libsodium-wrappers#^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of node-opus#^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of opusscript#^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of sodium#^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js#11.5.0 requires a peer of #discordjs/uws#^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js-commando#0.10.0 requires a peer of sqlite#^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN westeros-bot#1.0.0 No description
npm WARN westeros-bot#1.0.0 No repository field.
removed 426 packages and audited 12 packages in 7.294s
found 0 vulnerabilities```
You can try npm remove npm and run npm install to update package-lock.json file.

React-native not able to uninstall react-native-maps

Receiving following error when try to uninstall
$ npm uninstall --save react-native-maps/
npm WARN react-dom#15.5.4 requires a peer of react#^15.5.4 but none was installed.
npm WARN react-native#0.44.0 requires a peer of react#16.0.0-alpha.6 but none was installed.
npm WARN react-native-elements#0.9.7 requires a peer of react-native-vector-icons#~4.0.0 but none was installed.
npm WARN react-native-maps#0.13.0 requires a peer of react#>=15.4.0 but none was installed.
npm WARN react-native#0.41.2 requires a peer of react#~15.4.0 but none was installed.
npm WARN react-native-windows#0.41.0-rc.0 requires a peer of react-native#~0.41.0 but none was installed.
npm WARN react-native-windows#0.41.0-rc.0 requires a peer of react#~15.4.0 but none was installed.
npm WARN react-static-container#1.0.1 requires a peer of react#^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN react-test-renderer#15.4.2 requires a peer of react#^15.4.2 but none was installed.
Can someone tell, how to resolve these warnings and uninstall react-native-maps?
Make sure you have react and react-native modules installed. The message format WARN react-dom#15.5.4 requires a peer of react#^15.5.4 but none was installed. tells you that react-dom needs react but react is not present.
You also need to make sure you install the proper version of react and react-native.
Try to use
react-native unlink react-native-maps && yarn remove react-native-maps.It will remove all the related packages in android & ios folder also.