0

Please help me on this. I can't create a new Vue CLI project. It previously works good! Now not working...

Vue CLI v4.2.3

✨ Creating project in /Web develop/Vue Projects/new.

🗃 Initializing git repository...

⚙️ Installing CLI plugins. This might take a while...

npm ERR! Unexpected end of JSON input while parsing near '...loader":"~0.8.0","js-'

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Malaka/.npm/_logs/2020-03-25T06_30_10_474Z-debug.log ERROR command failed: npm install --loglevel error

4 Answers 4

3

seems a cache error

run

npm cache clean --force

then try create the project again

Sign up to request clarification or add additional context in comments.

Comments

0

That's weird. I'd just try re-installing the Vue cli package.

There is a deprecated vue-cli package, it could be you have that installed rather than the official one @vue/cli.

Either way just uninstall it with

npm uninstall [your-vue-cli-package] -g

Then re-install it again.

npm install @vue/cli -g

1 Comment

Thank you for reply its works when i run this command npm cache clean --force its was cache...
0

lets try this

$ sudo npm uninstall -g vue

$ sudo npm uninstall -g vue-cli

$ sudo npm uninstall -g @vue/cli

$ sudo npm cache clean --force

$ sudo npm install -g vue

$ sudo npm install -g @vue/cli

Comments

0

problem log:

npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
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\DraKoan\AppData\Local\npm-cache\_logs\2022-04-19T17_09_34_388Z-debug-0.log
 ERROR  Error: command failed: npm install --loglevel error --legacy-peer-deps
Error: command failed: npm install --loglevel error --legacy-peer-deps
    at ChildProcess.<anonymous> (C:\Users\DraKoan\AppData\Roaming\npm\node_modules\@vue\cli\lib\util\executeCommand.js:138:16)
    at ChildProcess.emit (node:events:526:28)
    at ChildProcess.cp.emit (C:\Users\DraKoan\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

Solve:

check proxy at config

npm config edit
npm config --global edit

clean and set proxy

npm config set proxy null
npm config set proxy false

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.