'Vue CLI error creating new project (npm error)
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
Solution 1:[1]
seems a cache error
run
npm cache clean --force
then try create the project again
Solution 2:[2]
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
Solution 3:[3]
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
Solution 4:[4]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Hank X |
Solution 2 | cd3k |
Solution 3 | Nguyá»…n DÆ°Æ¡ng |
Solution 4 | DraKoan |