trouble installing an npm package - react-native

I'm trying to install react-navigation in a react-native app I'm working on and I keep getting this error....
Standard error:
npm ERR! code 128
npm ERR! Command failed: C:\John\Applications\cygwin\bin\git.EXE clone -q git://github.com/react-navigation/react-native-tab-view.git C:\Users\John\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-e11f65d1 --config core.longpaths=true
npm ERR! fatal: Invalid path '/cygdrive/c/Users/John/AppData/Roaming/npm-cache/_cacache/tmp/C:\Users\John\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-e11f65d1': No such file or directory
npm ERR!
I have no problem with other packages, and I have git and it works. I have npm and it works.
So far I've manually deleted cpm cache from C:\Users\John\AppData\Roaming\npm_cache. Ran npm i -g npm Deleted package-lock.json
But nothing is working. Any ideas?

Figured it out. For my case at least I have git installed via cygwin and have cygwin in my path. I guess for some reason this package doesn't like that?
But I uninstalled git from cygwin and then installed it the 'normal' way and then it worked.

Related

npm ERR! code ENOTEMPTY npm ERR! syscall rename

when I try to initialize a react-native project I am getting this error. Anyone know how to resolve this please help
i am using mac
Need to install the following packages:
react-native
Ok to proceed? (y) y
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/react-native
npm ERR! dest /Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg
npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/react-native' -> '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/codelanticdeveloper/.npm/_logs/2022-02-16T15_54_46_715Z-debug-0.log
where it says...
directory not empty, rename '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/react-native' -> '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg'
delete the file after the arrow and try again
rm -rf '/Users/codelanticdeveloper/.npm/_npx/7930a8670f922cdb/node_modules/.react-native-QIQKGFeg'
Try deleting all the files in the node modules that end with a similar names, like '*-QIQKGFeg'
I did it manually and it worked for me
I also had this problem and fixed it by:
Deleting the problematic Expo files here per the instructions here I'm trying to reinstall expo-cli package globally with the command sudo npm install --g expo-cli note that I try --force
In the terminal, running nvm install 16.14.0 (this will download the correct Node.js LTS release that is required by Expo)
In the terminal, running brew install watchman (this is required by Expo)
In the terminal, running npm install --global expo-cli (globally downloading Expo again)
In the terminal, running expo init my-app to finally create the new app successfully!

foundation for emails can't create new project with npm error

I'm new to foundation and trying to start foundation for emails sass version. I installed foundation-cli by npm globally with this version:
Foundation CLI version 2.2.5
Then I cd to an empty folder and try start a tester project by the following command
foundation new --framework emails
The project setup failed:
Downloading the project template... Done downloading!
Installing dependencies...
npm ERR! git rev-list -n1 4.0: fatal: ambiguous argument '4.0':
unknown revision or path not in the working tree. npm ERR! git
rev-list -n1 4.0: Use '--' to separate paths from revisions, like
this: npm ERR! git rev-list -n1 4.0: 'git [...] --
[...]' npm ERR! git rev-list -n1 4.0:
There were some problems during the installation.
✓ New project folder created. ✗ Node modules not installed. Try
running npm install manually. ✓ Bower components installed.
so I cd to the newly created project folder and npm install. It still failed.
npm ERR! code 1 npm ERR! Command failed: /usr/bin/git checkout 4.0 npm
ERR! error: pathspec '4.0' did not match any file(s) known to git. npm
Can anyone give me a hint how to resolve it??
The problem is that there was once an 4.0 tag for Gulp but it was deleted. Just run npm i gulp#next --save-dev or npm i gulp#4.0.0 --save-dev.
It was fixed in https://github.com/zurb/foundation-zurb-template/commit/a4472d7fc2409b43bbdc4df4dead7eb5e8e0e691 (see the change in package.json).
I had the same error.
First install gulp manually following these steps
https://gulpjs.org/getting-started.html.
Then if you get an error saying VCBuildtools arent't installed. Install them via
choco install vcbuildtools
After that it should work.
Try the manual install from here:
https://github.com/zurb/foundation-emails-template#manual-setup
Use Yarn instead of npm
Worked for me on a few different machines.

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

npm install ethereum/web3.js - gives me an error

npm install ethereum/web3.js --save
I get:
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.
I was also facing same issue but it's simple to solve it. Follow the below step it works for me.
1) Download git from here and install on your PC.
2) Then just restart your CMD.
3) Then Execute npm install ethereum/web3.js --save Command.
And you are good to go. Hope it will be helpful for others also.
Run cmd with Administrator privilege
Run => npm install --global --production windows-build-tools
Run => npm install --save web3#1.0.0-beta.26 (in your project directory)
this worked for me! simply type web3.js

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.