I tried creating project using vue create but I get following error all the time
✨ Creating project in C:\Users\....
⚙️ Installing CLI plugins. This might take a while...
npm ERR! Unexpected end of JSON input while parsing near '..."^5.8.23","babel-tape'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HariC\AppData\Roaming\npm-cache\_logs\2020-08-01T13_14_04_441Z-debug.log
ERROR command failed: npm install --loglevel error
I have chosen everything in except typescript support and es-lint while creating the app.
What could be the reason?
Try clearing the cache:
npm cache clean --force
Probably the error was due to corrupt cache. Referred to - https://stackoverflow.com/a/47896884/9640177
npm cache clean --force
Related
Previously used this command;
npx create-react-app 'project_name'
-but now this is giving error, used other commands as;
npx create-react-app#latest 'project_name'
npm create-react-app 'project_name'
node version is: v16.17.0
npm version: 9.1.2
same error, then tried to use uninstall react globally and installed it again and tried
npx create-react-app 'project_name'
and having same error again..
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/#typescript-eslint%2ftypescript-estree: aborted
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ST\AppData\Local\npm-cache\_logs\2022-11-29T19_03_34_604Z-debug-0.log
only packages.json file is created and at failure it is also deleted...
As this command was working fine just a few days ago
npx create-react-app
I am new to this framework if there is a mistake kindly help me along..
It clearly states that your error comes from a network connection. It may be caused by a VPN. Anyway, if you are new to React and if I may suggest a better solution for you to start a project... CRA is outdated nowadays. Use Vite. Just run this
npm create vite#latest some-react-app-name --template react
I just wanted to create a new NextJS Project using yarn create next-app <project-name>, but at the "installing dependencies" step, yarn fails with the following error message:
error https://registry.yarnpkg.com/#next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.0.4.tgz: incorrect data check [same error with different packages] error https://registry.yarnpkg.com/next/-/next-12.0.4.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?" info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. error https://registry.yarnpkg.com/#next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-
I also get this error when normally trying to install npm packages with yarn. Apparently this seems to be some error with extracting some tar files, but I'm not sure about the exact cause of the error and how to fix it. Reinstalling yarn did unfortunately not fix the error. How can I fix this?
Edit:
Using npm doesn't work as well, and I get the following error:
npm WARN tar zlib: incorrect data check npm WARN tarball tarball data for #next/swc-darwin-x64#https://registry.npmjs.org/#next/swc-darwin-x64/-/swc-darwin-x64-12.0.4.tgz (sha512-PVgefMWjxP6CU1HQs39+Bfpjcue6qErJfvJ/+n2zimjLzyeQAmD6LM9f1lDSttW2LjKjasoxR5qkRNLVlqzlaA==) seems to be corrupted. Trying again. npm ERR! code Z_DATA_ERROR npm ERR! errno -3 npm ERR! zlib: incorrect data check
I'm trying to adapt an external API named cric-live into my node application for displaying cricket scores in my application. When I try to install the dependency, it shows an error as below
PS F:\Node Express\NodeJS\cric api> npm i cric-live
npm ERR! Unexpected end of JSON input while parsing near '...":"request-promise","'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Thiluxan\AppData\Roaming\npm-cache\_logs\2020-07-01T04_51_42_400Z-debug.log
This is the source link for the dependency I'm trying to install
https://www.npmjs.com/package/cric-live?activeTab=readme
Your npm cache maybe busted so I would say run this code first and try installing the package again
npm cache clean --force
I am new to react and I am trying to create a new create an app, but whatever I do, I get same error.
:npm ERR! Unexpected end of JSON input while parsing near '...nt":"^7.1.0","babel-p'
I think there is some problem with babel.
C:\Users\Augustus\Desktop>npx create-react-app myapp
Creating a new React app in C:\Users\Augustus\Desktop\myapp.
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 '...nt":"^7.1.0","babel-p'
npm ERR! A complete log of this run can be found in:
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting myapp/ from C:\Users\Augustus\Desktop
Done.
force a reinstall
usually you can fix these kinds of errors by forcing a reinstall
try
npm cache clean --force
or
yarn --force
depending on if you are using npm or yarn for package management
After forcing a reinstall, if you see that you are still getting the same error, check your internet connection. I had the same issue until I switched to a faster provider (in my third world country, internet can be slow at times) after which it immediately installed as it should have.
I just want to create a new React app with:
npx start-react-app my_new_app
But I get this error:
npm ERR! code E404
npm ERR! 404 Not Found: crate-react-app#latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hugovillalobos/.npm/_logs/2018-12-17T21_01_13_727Z-debug.log
Install for crate-react-app#latest failed with code 1
I attempted to do it with sudo privileges, but I just got the same error.
EDIT
I found that the error rises because I created the React app and then removed the whole directory in order to start over. Now, when I try to use the same directory name in the same parent directory, I get this error. When I use another directory, everything works with no problem.
I guess there should be some global React configurations that must be cleared besides just erasing the directory.
You can try to follow steps here https://www.valentinog.com/blog/react-webpack-babel/ It should work.
npm i react react-dom --save-dev