Not able to install npm install react-native-gesture-handler - reactjs

I am trying to use React Native Navigation 5. I have added all the dependency but when i am adding
npm install react-native-gesture-handler it is giving the below error:
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/naver/hammer.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Then i followed the below solution and downloaded the Github, save the path in System Variable but it did not work. Please suggest what wrong i am doing.
https://stackoverflow.com/a/23179102
My package.json
{
"name": "NavigationExample",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#egjs/hammerjs": "^2.0.17",
"#react-native-community/masked-view": "^0.1.6",
"#react-navigation/native": "^5.0.1",
"#react-navigation/stack": "^5.0.1",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-reanimated": "^1.7.0",
"react-native-safe-area-context": "^0.7.2",
"react-native-screens": "^2.0.0-beta.2"
},
"devDependencies": {
"#babel/core": "7.8.4",
"#babel/runtime": "7.8.4",
"#react-native-community/eslint-config": "0.0.5",
"babel-jest": "24.9.0",
"eslint": "6.8.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.56.4",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
It is working fine on mac but not working on Windows 10 Home.

This link helped me to get out of this issue: Here's a link
In short Download Git then follow the below steps:
Open Environment Variables
Edit Path
Find your git location that been installed in your device. Example like mine is C:\Program Files\Git\cmd
Add the git location to Path (make sure to add this to both user variables and system variables)
Apply the changes and restart your pc
Lastly, go back to your project and run npm install react-native-gesture-handler

This looks like a permission error. Please run your command line as a Administrator.

delete your node module and try again
npm install

Related

In react native #react-navigation/native-stack error occured

I was trying to input 'npm install #react-navigation/native-stack' In my vscode's terminal to install #react-navigation/native-stack but during installing, error occured.
The following is error message.
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git#github.com/react-navigation/native-stack.git
npm ERR! ERROR: Repository not found.
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! A complete log of this run can be found in:
npm ERR! path(my log files path)
my package.json file
{
"name": "userinterface",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"#react-navigation/native": "^6.0.13",
"expo": "~46.0.9",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-native": "0.69.5",
"react-native-screens": "~3.15.0",
"react-native-safe-area-context": "4.3.1",
"undefined": "react-navigation/native-stack"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
"private": true
}
I'm newbie for react-native and programming. so I don't know what to upload here. if you need more information to solve this problem, I will upload that.
It could be a compatibility issue. Try running
npm install npm#latest -g
and check again
I think there was a mistake in your package.json. It should be a package name following it's version. In this case it's should be
"dependencies": {
"#react-navigation/native": "^6.0.13",
"expo": "~46.0.9",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-native": "0.69.5",
"react-native-screens": "~3.15.0",
"react-native-safe-area-context": "4.3.1",
"react-navigation/native-stack": "^6.9.0"
},

React full stack app deploy to Google App Engine with error webpack: not found

everyone. I try to deploy Reack full stack app from https://github.com/crsandeep/simple-react-full-stack
And it doesn't work. I read too many posts about deploying react to gcloud but there are simple apps and not full stack apps.
my packege.json, I took it from git
{
"name": "simple-react-full-stack",
"version": "1.0.0",
"description": "Boilerplate to build a full stack web application using React, Node.js, Express and Webpack.",
"main": "src/server/index.js",
"scripts": {
"build": "webpack --mode production",
"start": "npm run build && node src/server/index.js",
"client": "webpack-dev-server --mode development --devtool inline-source-map --hot",
"server": "nodemon src/server/index.js",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"author": "Sandeep Raveesh",
"license": "ISC",
"dependencies": {
"babel-polyfill": "^6.26.0",
"express": "^4.16.3",
"react": "^16.5.2",
"react-dom": "^16.5.2"
},
"devDependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.0.0",
"#babel/preset-env": "^7.0.0",
"#babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.0",
"babel-loader": "^8.0.0",
"clean-webpack-plugin": "^1.0.0",
"concurrently": "^4.0.0",
"css-loader": "^2.0.0",
"eslint": "^5.0.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^3.0.0",
"html-webpack-plugin": "^3.2.0",
"nodemon": "^1.17.3",
"style-loader": "^0.23.0",
"url-loader": "^1.0.1",
"webpack": "^4.5.0",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.3"
}
}
my app.yaml I took it from google
env: flex
runtime: nodejs
I run in terminal
gcloud beta app deploy
And I have error
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.beta.app.deploy) Error Response: [9]
Application startup error:
> simple-react-full-stack#1.0.0 prestart /app
> npm run bundle
> simple-react-full-stack#1.0.0 bundle /app
> webpack --config webpack.config.js
sh: 1: webpack: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! simple-react-full-stack#1.0.0 bundle: `webpack --config webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the simple-react-full-stack#1.0.0 bundle script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-04T18_45_03_238Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! simple-react-full-stack#1.0.0 prestart: `npm run bundle`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the simple-react-full-stack#1.0.0 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-04T18_45_03_252Z-debug.log
I don't understand what it need, I tried to add "npm install" and it doesn't work too.
How fix it?
Here is a community tutorial you can follow, get everything working as described first and then start making the desired edits.
Please make sure you are following the steps of "Preparing the app" section, as it seems like you are missing on of the mentioned steps.
npm init
npm install --save webpack express pug
As well as modifying package.json to include:
"scripts": {
"bundle": "webpack --config webpack.config.js",
"prestart": "npm run bundle"
}
Also note that:
Webpack must be listed in the dependencies of the package.json file,
as by default devDependencies are not installed when the app is
deployed to Google App Engine.
Also keep in mind that gcloud beta app deploy is still in BETA and may have changes without notice. So for what you are trying to achieve there is no need for using beta. Instead simply use gcloud app deploy.

Upgrading React native from 0.57 to 0.58.5

After upgrading to React Native 0.58.5 from 0.57, there is an error whenever installing a npm module:
npm WARN react-native#0.58.5 requires a peer of react#16.6.3 but none is installed. You must install peer dependencies yourself.
npm ERR! path C:\d\code\js\emps\node_modules\colors
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\d\code\js\emps\node_modules\colors' -> 'C:\d\code\js\emps\node_modules\.colors.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\JunC\AppData\Roaming\npm-cache\_logs\2019-02-25T23_49_59_940Z-debug.log
Here is the part of package.json:
"dependencies": {
"react": "^16.8.2",
"react-native": "^0.58.5",
"react-native-code-push": "^5.5.2",
"react-native-device-info": "^0.26.4",
"react-native-gifted-chat": "^0.7.2",
"react-navigation": "^3.3.0"
},
The react version is alreay 16.8.2 which is newer than what the message suggests. What causes the error message? Is the react-native too new?
pertaining to the npm ERR!, you are required to run npm install color -S as the color package is missing from your json file.
hope this helps!
I end up reinstalling the whole system and notice that the react version is locked at 16.6.2 which is not the latest one (16.8.2). The problem may be incompatibility issues caused by newer react. Here is part of package.json after re-installation:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.5",
"react-native-code-push": "^5.5.2",
"react-native-device-info": "^0.26.4",
"react-native-gifted-chat": "^0.7.2",
"react-native-navigation": "^2.12.0",
"react-navigation": "^3.3.2"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.1.0",
"jest": "24.1.0",
"metro-react-native-babel-preset": "0.52.0",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}

"react-scripts start" error on new machine

I made a project (on macos) with "create react app" and committed on git.
Now I'm cloning the folder on Windows and I'm following usual steps:
node
npm
npm install
Anyway I'm having this issue back:
$ npm start
> name#0.1.0 start \\Mac\Home\Desktop\WindowsProgetti\WebApp
> react-scripts start
'\\Mac\Home\Desktop\WindowsProgetti\WebApp'
CMD.EXE è stato avviato utilizzando il percorso precedente come directory
corrente. I percorsi UNC non sono supportati. Per impostazione predefinita,
verrà utilizzata la directory di Windows.
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '\\Mac\Home\Desktop\WindowsProgetti\WebApp\node_modules\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:279:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the matchplat#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\fabio\AppData\Roaming\npm-cache\_logs\2018-09-21T13_56_21_061Z-debug.log
(I know... something is in Italian language, most important stuff is English anyway.)
Package.json
{
"name": "name",
"version": "0.1.0",
"private": true,
"homepage": "http://localhost:3000",
"dependencies": {
"#material-ui/core": "^3.0.0",
"#material-ui/icons": "^3.0.0",
"create-react-app": "^1.5.2",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-intl": "^2.4.0",
"react-loadable": "^5.5.0",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Did lot of research on the web and on stack... lots of user having this issue but none of their solution worked for me.
Any suggestions?
Thanks a lot.
Solution:
Using PARALLELS... be sure that your project is not on on "shared" space between the two OS.
I've been not able to execute the project in the mac folder.
Been not able to execute on shared space
Worked on Windows Only space.
Thanks.

Angular quickstart error

I'm trying to run tutorials from angular.io. I'm getting an error on npm start.
Here is the error. I tried to uninstal all npm, typescript, node, angular.
First part of the error:
npm WARN invalid config loglevel="notice"
> angular-quickstart#1.0.0 build C:\Users\Gia\quickstart
> tsc -p src/
src/app/app.component.spec.ts(3,50): error TS2307: Cannot find module '#angular/core/testing'.
src/app/app.component.spec.ts(4,30): error TS2307: Cannot find module '#angular/platform-browser'.
src/app/app.component.spec.ts(5,30): error TS2307: Cannot find module '#angular/core'.
src/app/app.component.spec.ts(7,1): error TS2304: Cannot find name 'describe'.
src/app/app.component.spec.ts(12,3): error TS2304: Cannot find name 'beforeEach'.
src/app/app.component.spec.ts(19,3): error TS2304: Cannot find name 'beforeEach'.
src/app/app.component.spec.ts(25,3): error TS2304: Cannot find name 'it'.
src/app/app.component.spec.ts(25,39): error TS2304: Cannot find name 'expect'.
src/app/app.component.spec.ts(27,3): error TS2304: Cannot find name 'it'.
src/app/app.component.spec.ts(30,5): error TS2304: Cannot find name 'expect'.
src/app/app.component.ts(1,27): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(1,31): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(2,31): error TS2307: Cannot find module '#angular/platform-browser'.
src/main.ts(1,40): error TS2307: Cannot find module '#angular/platform-browser-dynamic'.
The second part of the error:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Gia\AppData\Roaming\npm-cache\_logs\2017-06-12T15_05_48_144Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 prestart: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is the package.json file:
{
"name": "angular-quickstart",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"build:e2e": "tsc -p e2e/",
"serve": "lite-server -c=bs-config.json",
"serve:e2e": "lite-server -c=bs-config.e2e.json",
"prestart": "npm run build",
"start": "concurrently \"npm run tsc:w\" \"npm run serve\"",
"pree2e": "npm run build:e2e",
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
"preprotractor": "webdriver-manager update",
"protractor": "protractor protractor.config.js",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"pretest:once": "npm run build",
"test:once": "karma start karma.conf.js --single-run",
"lint": "tslint ./src/**/*.ts -t verbose"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"#angular/common": "~4.0.0",
"#angular/compiler": "~4.0.0",
"#angular/core": "~4.0.0",
"#angular/forms": "~4.0.0",
"#angular/http": "~4.0.0",
"#angular/platform-browser": "~4.0.0",
"#angular/platform-browser-dynamic": "~4.0.0",
"#angular/router": "~4.0.0",
"angular": "^1.6.4",
"angular-in-memory-web-api": "~0.3.0",
"core-js": "^2.4.1",
"node": "0.0.0",
"rxjs": "5.0.1",
"systemjs": "0.19.40",
"zone.js": "^0.8.4"
},
"devDependencies": {
"concurrently": "^3.2.0",
"lite-server": "^2.2.2",
"typescript": "~2.1.0",
"canonical-path": "0.0.2",
"tslint": "^3.15.1",
"lodash": "^4.16.4",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~4.0.14",
"rimraf": "^2.5.4",
"#types/node": "^6.0.46",
"#types/jasmine": "2.5.36"
},
"repository": {}
}
Here is an error after installing npm in the folder of application:
src/app/app.component.spec.ts(3,50): error TS2307: Cannot find module '#angular/core/testing'.
src/app/app.component.spec.ts(4,30): error TS2307: Cannot find module '#angular/platform-browser'.
src/app/app.component.spec.ts(5,30): error TS2307: Cannot find module '#angular/core'.
src/app/app.component.ts(1,27): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(1,31): error TS2307: Cannot find module '#angular/core'.
src/app/app.module.ts(2,31): error TS2307: Cannot find module '#angular/platform-browser'.
src/main.ts(1,40): error TS2307: Cannot find module '#angular/platform-browser-dynamic'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Gia\AppData\Roaming\npm-cache\_logs\2017-06-12T15_26_01_665Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart#1.0.0 prestart: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Those are mostly errors within the test files or missing imports within each component. You need to fix all of them before you can compile your app successfully. It doesn't seem to be a bug.
I suggest using angular-cli to create a new angular app and keep on building the tutorial components from there. Angular-cli is the official tool for creating and scaffolding angular apps.

Resources