Vue : Unexpected end of JSON input while parsing near '...version":"0.5.0","dev' - vue.js

I am Learning Vue JS. Planning to develop application on it. Initially I installed Vue by
npm install vue-cli -g
But some of good Friend told me that this is Depreciated. Its there in the documentation also.
Vue Javascript with npm install command
https://cli.vuejs.org/guide/installation.html
But unable to install Vue by cmd:
npm install -g #vue/cli
this gives me Error as :
npm ERR! Unexpected end of JSON input while parsing near '...version":"0.5.0","dev'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Abhilash\AppData\Roaming\npm-cache\_logs\2020-05-13T12_14_23_300Z-debug.log
What may be the Error ? How overcome from this ?

Try cleaning npm cache and then install vue
npm cache clean --force
npm install -g #vue/cli

Related

Create React App install in Mac says MODULE_NOT_FOUND

I was trying to install Create React App using npm install -g create-react-app . The installation runs well without problem. There was an error that popped up when I entered npm start which is similar to snapshot below. I am using macOS High Sierra version 10.13.x and npm version 13.6.4.
Even though it says "Successfully created my-app", cd my-app and then npm start running the command in console shows following lines of errors that goes like,MODULE_NOT_FOUND.
Do anyone knows that version of npm has a issue installing create react app in Mac, please help.
i.e. >
internal/modules/cjs/loader.js:628
throw e;
^
Error: No valid exports main found for '/Users/Nirmala1/React/my-app/node_modules/postcss-safe-parser/node_modules/postcss'
at resolveExportsTarget (internal/modules/cjs/loader.js:625:9)
at applyExports (internal/modules/cjs/loader.js:502:14)
at resolveExports (internal/modules/cjs/loader.js:551:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:657:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27)
at Function.Module._load (internal/modules/cjs/loader.js:855:27)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/Nirmala1/React/my-app/node_modules/postcss-safe-parser/lib/safe-parse.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1144:30) {
code: 'MODULE_NOT_FOUND'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#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:
Fixed this problem by upgrading node.js to v14.5, i've had v13.5 and v13.6 before on my Mac.Tried to solve by removing create-react-app globally:
npm uninstall -g create-react-app
and using:
npx create-react-app myapp
But it didn't work for me. I installed latest version of node using curl -o- url command to download, like
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
and to install using nvm install version. nvm install v14.15.1
and npx create-react-app myapp
worked well by loading create react app page in http://localhost:3000/.
I came across the same issue with code: 'MODULE_NOT_FOUND' on Ubuntu. I was using an older version of node at the time. All I had to do was to upgrade to the latest version by using the Node Version Manager nvm
Type in the command line:
nvm install stable
That should get you the latest version and then go back to your react app and do as before npm start.

Vue Js Installation

Tried installing vue js through
npm install -g #vue/cli.
My npm version is 6.14.4 and node version is 12.16.2
This is the error i am getting
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! Unexpected end of JSON input while parsing near '...nEaUD\r\n=F4TR\r\n---'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sudesh\AppData\Roaming\npm-cache\_logs\2020-04-16T01_32_53_989Z-debug.log
I tried looking into the repo. I didn't understand what is the solution for this problem.
Try npm cache clean --force and then run the npm install -g #vue/cli . I think this must solve your issue.
Try npm cache clean --force and then run the npm install -g #vue/cli I think this must solve your issue.
Basically, use the npm cache clean --force command in our terminal to delete all data from your cache folder after that run npm install -g #vue/cli. then run vue create myapp to create your vue CLI app
Step : 1 npm cache clean --force
Step : 2 npm install -g #vue/cli
clean npm cache: npm cache clean --force
if you are using mac or Linux try with sudo npm install -g #vue/cli
for windows npm install -g #vue/cli

Error while installing vue CLI: npm ERR! Unexpected end of JSON input while parsing near '...ulp-rename":"0.0.33",'

I had an older version of vue CLI and i want to upgrade to CLI 3, so first what I did is unistall the previous version:
npm uninstall vue-cli -g
Then tried to install:
npm install -g #vue/cli
I got the following error:
npm ERR! Unexpected end of JSON input while parsing near '...ulp-rename":"0.0.33",'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\31089\AppData\Roaming\npm-cache\_logs\2020-02-02T11_48_31_187Z-debug.log
The complete log information can be found here
My node version: v12.14.0
My npm version: 6.13.4
And I tried
npm cache clean --force
but didn't work.
I figured out, if you run command prompt window as an administrator, then first do
npm cache clean --force
then can install successfully.

How to fix "npm ERR! Unexpected end of JSON input while parsing" on Vue CLI installation

I want to install Vue CLI . and i run this on my Git Bash .
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
but having error like this :
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
npm ERR! Unexpected end of JSON input while parsing near '...ery":"latest","throug'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ECLIPSE\AppData\Roaming\npm-cache\_logs\2019-10-09T02_48_52_427Z-debug.log
i try with solution in stackoverflow in this thread here
. i try with
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~/Desktop
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
but i try to install again , its have same error . someone can help me about this ?
I had a very similar problem and simple npm cache clean --force command did not help too.
I solved the problem by deleting C:\Users\User\AppData\Roaming\npm and C:\Users\User\AppData\Roaming\npm-cache directories and running an npm cache clean --force command after this. Then, npm install worked properly.
If the problem continues to appear, reinstall Node.js and NPM. Do not forget to check if all previous files connected with them are deleted before the installation!
This process work for me
1 - Run your Command Invite/Terminal as Administrator
2 - Install the Vue CLI globally with the command :
npm install -g vue-cli

i got errors when i try to install a vuetify project via npm

i followed these in the process of installation of a vuetify project:
-npm install -g vue-cli
-vue init vuetifyjs/webpack my-project
here is the result among all errors displayed:
-npm ERR! Unexpected end of JSON input while parsing near '...","eslint":"^1.3.1","'
you need to clear the npm cache.
try with
npm cache clean --force
npm install -g vue-cli
vue init vuetifyjs/webpack my-project