Error when yarn add and npm i - react-native

Good evening!
i'm trying to add some packages to my native react application but it's not working with either npm or yarn. i have uninstalled and reinstalled yarn but it has not changed anything
I use Windows 10.
for yarn :
yarn add react-navigation
yarn add v1.5.1
[1/4] Resolving packages...
error An unexpected error occurred: "Couldn't find the binary git".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\Boubacar\\Desktop\\blob\\essai\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
for npm :
npm i react-navigation
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Boubacar\AppData\Roaming\npm-cache\_logs\2018-04-08T00_02_28_158Z-debug.log.
Help me please!

The console log is plain and clear.
error An unexpected error occurred: "Couldn't find the binary git".
Check/Install Git on your system.

For Windows users, need to set environment path, like
C:\Program Files\Git\cmd

Related

Visual Studio Code Extension - npm installation failed becuase of package dependency?

I'm trying to write a small extention for Visual Studio Code but it fails right at the beginning.
I installed yo, as intended
npm install -g yo generator-code
however, now when I'm trying to start everything up, I get errors.
I created a project using yo code and following the generator. I tried Extension Typescript and Javascript, both failed.
the settings used:
initialize a git repository: yes
package manager: npm
Running npm install for you to install the required
dependencies. If this fails, try running the command yourself.
The auto installation failed, running npm install however caused the same error:
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EPROTO: request to https://registry.npmjs.org/mocha failed, reason: write EPROTO 10300:error:14094417:SSL routines:ssl3_read_bytes:sslv3 alert illegal parameter:c:\\ws\\deps\\openssl\\openssl\\ssl\\record\\rec_layer_s3.c:1407:SSL alert number 47\n
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #types/vscode#^1.43.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'smartfilesnfolders'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lechn\AppData\Roaming\npm-cache\_logs\2020-03-10T12_50_32_409Z-debug.log
full log: https://gist.github.com/lechnerio/e1356b2edb48cbdedf40fd1570267bb7
thankful for any hints and tips. npm and vscode are up to date.
I've got the same error a moment ago. I solved it by changing #types/vscode version to ^1.42.0 in package.json.

I can't install anything with npm command line

I have been using npm for some time with ionic. Recently, it started giving an error when trying to install anything both packages and modules. Even with react native it gives the same error.
I have tried re-installing it, but that didn't fix it. I created a new user on my Windows system, but it's still not working, and I noticed that when I search for the error code on Google, I get no results.
C:\WINDOWS\system32>npm install -g ionic
npm ERR! error:0909006C:PEM routines:get_name:no start line
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\OLAMIDE AWOBUSUYI\AppData\Roaming\npm-cache_logs\2019-07-11T19_47_18_673Z-debug.logenter image description here
Try to set the npm registry:
npm set registry http://registry.npmjs.org/

npm install host key verification failed

I ran npm install in angular2+ project directory and got below error which I cannot understand at all.
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t ssh://git#bitbucket.org/path/projectname.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
I have created ssh key on bitbucket and account and saved it on drive. |
I have clone project from bitbucket.
What does this error has to do with that?
As I am new on project so don't have much knowledge.
Do I need to provide ssh key while npm install as well?
Please let me know if I can provide more info related to question.
Thanks!
Please check the npm version that you are using. Npm comes bundled with node and you shouldn't have multiple instances on your classpath.
Hey yup, I thought as much, but seeing as I had updated npm to the
latest version ( I even uninstalled node and reinstalled ) with the
same result. npm -v still showed the same version - 1.4.9.
FYI for others that may have the same issue. I also have Chocolatey
installed, and it seems that npm was also installed via Chocolately
which seems to overide the npm path. Uninstalling npm from Chocolately
resolved the npm version issue.
After that angular/cli installs correctly from npm.
https://github.com/angular/angular-cli/issues/6313#issuecomment-301360623

Can't install "react native cli" globally by using git bash

When I type in "npm install -g react-native-cli" at git bash I get following errors:
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at: npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\TOSHIBA İ5\AppData\Roaming\npm-cache_logs\2017-10-19T04_04_05_774Z-debug.log
I have already installed npm and added it's directory to PATH variable and when i type "which npm" at git bash it shows the directory so there is no problem about the installation of npm. But it still gives these errors and I am stuck.
Note: I am following the instructions on https://shift.infinite.red/getting-started-with-react-native-development-on-windows-90d85a72ae65
This could happen in some npm old versions. Make sure you are using an updated one.
npm install -g npm
Some linux distros have old versions of npm and node on their packages and you need to install it manually.
Edit: I just saw you have windows. Nevermind, still the old version could be a problem.

Error when using 'create-react-native-app'

I tried to create a new React Native app using the command create-react-native-app in the node.js terminal on my Windows system. I got the following terminal error:
D:\project>create-react-native-app crna
Creating a new React Native app in D:\project\crna.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Suppor
t
npm WARN deprecated #exponent/spawn-async#1.2.8: Please switch to #expo/spawn-as
ync, the new name of this package. It's the same code with our new name.
npm ERR! shasum check failed for C:\Users\ui-admin\AppData\Local\Temp\npm-3204-a
eacedd1\registry.npmjs.org\_40exponent\ngrok\-\ngrok-2.2.7.tgz
npm ERR! Expected: 37fe66f922b1003da2a78c66b7d4d3bc9313e423
npm ERR! Actual: d134060eb730b880da06d5c040ca933f6a75b613
npm ERR! From: https://registry.npmjs.org/#exponent/ngrok/-/ngrok-2.2.7.tgz
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ui-admin\AppData\Roaming\npm-cache\_logs\2017-05-26T09_36_
04_379Z-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed
Anyone met this error or fix it?
I got the same error, though in RubyMine, which provided the response that react-native doesn't work with npm 5 yet. it said you can either revert to npm 4 or feel free to log an issue here: https://github.com/npm/npm/issues/16991
I think you're best bet would be to revert and wait it out!