I am trying to create a react app using these two commands .Here are the two commands.
npm install -g create-react-app
create-react-app my-app
I am getting this error on my terminal .
npm ERR! Unexpected end of JSON input while parsing near '...org/jest/-/jest-20.
0.'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\satyajeet\AppData\Roaming\npm-cache\_logs\2018-04-01T16_28
_34_038Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts
has failed.
Deleting generated file... package.json
Related
I created a React Native project with Expo using expo init MapTry. I am currently trying to install MapBox library into it. For some reason I get an error at the first step after trying to install it. I followed this guide of installation: https://github.com/rnmapbox/maps#Installation but for some reason I am getting an error message when I try to run npm install rnmapbox/maps#main --save from the terminal. The error says the following:
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
I also tried to search for it in the official NPM site and found this one: https://www.npmjs.com/package/#rnmapbox/maps . After running the following code: npm i #rnmapbox/maps which was written there, I get the same error message as written above. What should I do? How can I use MapBox library in React Native?
try to run this command in your terminal
with NPM
npm install #rnmapbox/maps --save
with YARN
yarn add #rnmapbox/maps
I have been trying to create my first React App for a while now and it has been flagging me different errors.
This is the code I typed in my Hyper terminal: "npx create-react-app app".
After trying to download for some minutes it would then flag the error below:
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Edmund Obinna\AppData\Local\npm-cache_logs\2022-02-22T11_18_49_833Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting app/ from C:\Users\Edmund Obinna
Done.
getting this error in creating a react-app
C:\Users\HP\Desktop\New folder (2)\react>npx create-react-app keeper
Creating a new React app in C:\Users\HP\Desktop\New folder (2)\react\keeper.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code EIO
npm ERR! syscall read
npm ERR! errno -4070
npm ERR! EIO: i/o error, read
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Local\npm-cache\_logs\2021-01-
20T11_27_54_540Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-
scripts cra-template has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting keeper/ from C:\Users\HP\Desktop\New folder (2)\react
Done.
npm ERR! code 1
npm ERR! path C:\Users\HP\Desktop\New folder (2)\react
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-react-app
keeper
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Local\npm-cache\_logs\2021-01-
20T11_28_32_438Z-
debug.log
how to solve this problem previously i am able to create react app easily
but this gives error.
I am trying to create a react app with
create-react-app
but it get the following error
Creating a new React app in /home/freduah/react-jumia-clone/react-jumia-clone.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Unexpected end of JSON input while parsing near '...ct-assign":"^2.0.0","'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/freduah/.npm/_logs/2020-10-26T11_32_34_616Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting react-jumia-clone/ from /home/freduah/react-jumia-clone
Done.
Have you tried clearing your cache using npm cache clean --force?
Check your version of npm and other
or,
Try deleting cache in the terminal as :
npm cache clean --force
I am in my initial stages of learning react and have a limited understanding of npm manager and importing libraries into project.
For my current project, I had installed react-native using
npm install react-native
This also reflects in my package.json and node_modules folder
"react-native": "^0.61.5"
Now, when I try to import react-native as follows into AppCarousel.js
import React from 'react';
import {Dimensions} from 'react-native';
and then build the application , i get the following error message
.\src\Components\AppCarousel.js
Cannot find module: 'react-native'. Make sure this package is installed.
You can install this package by running: npm install react-native.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react#1.0.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react#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\{USER}\AppData\Roaming\npm-cache\_logs\2020-01-09T13_08_54_364Z-debug.log
The terminal process terminated with exit code: 1
I tried referring to the the following questions i) link1 ii)link2
I cannot make out if this is a bug in npm or if there is a lack of understanding for installing packages on my side. Any help will be appreciated, thanks.
Terminal to kill the process:
ps -ax | grep npm
Then try to navigate to your directory in your terminal and try to do write this:
npm I react
or again:
npm i react-native
Simple explanation to get in use with TypeScript and React:
https://facebook.github.io/react-native/docs/typescript