Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue-cli-service@latest not found

Tags:

vue.js

Installed vue-cli globally, tried npm run serve, didnt work. So tried another command from the vue documentation -

npx vue-cli-service serve

And it throwed this error:

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/local/bin/node',
    1 verbose cli   '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
    1 verbose cli   'install',
    1 verbose cli   'vue-cli-service@latest',
    1 verbose cli   '--global',
    1 verbose cli   '--prefix',
    1 verbose cli   '/Users/alexsexotic/.npm/_npx/98241',
    1 verbose cli   '--loglevel',
    1 verbose cli   'error',
    1 verbose cli   '--json' ]
    2 info using [email protected]
    3 info using [email protected]
    4 verbose npm-session 494918c2f272d4c2
    5 silly install loadCurrentTree
    6 silly install readGlobalPackageData
    7 http fetch GET 404 https://registry.npmjs.org/vue-cli-service 1250ms
    8 silly fetchPackageMetaData error for vue-cli-service@latest 404 Not Found: vue-cli-service@latest
    9 timing stage:rollbackFailedOptional Completed in 2ms
    10 timing stage:runTopLevelLifecycles Completed in 1408ms
    11 verbose stack Error: 404 Not Found: vue-cli-service@latest
    11 verbose stack     at fetch.then.res (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
    11 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    11 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
    11 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
    11 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    11 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    11 verbose stack     at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
    11 verbose stack     at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
    11 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
    11 verbose stack     at runCallback (timers.js:705:18)
    11 verbose stack     at tryOnImmediate (timers.js:676:5)
    11 verbose stack     at processImmediate (timers.js:658:5)
    12 verbose cwd /Users/alexsexotic/Desktop/work/Test - mongod:node/client
    13 verbose Darwin 17.2.0
    14 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "install" "vue-cli-service@latest" "--global" "--prefix" "/Users/alexsexotic/.npm/_npx/98241" "--loglevel" "error" "--json"
    15 verbose node v10.14.0
    16 verbose npm  v6.4.1
    17 error code E404
    18 error 404 Not Found: vue-cli-service@latest
    19 verbose exit [ 1, true ]

Why was this error thrown?

like image 664
Alex Nguyen Avatar asked Nov 07 '22 23:11

Alex Nguyen


1 Answers

You need to install the Vue CLI Service before you can run the binary. Try installing at the project-level as opposed to globally instead.

The 404 is a "feature" of npx whereby it attempts to download (then execute) missing packages unless the --no-install flag is passed. The reason it cannot find vue-cli-service is because that particular package doesn't exist in the registry.

Note the package name for Vue CLI Service is @vue/cli-service which differs from the name of the binary it installs. Let's hope no one is ever able to register a module called vue-cli-service for security reasons. Because if they do you'd've downloaded and run their module instead.

like image 174
vhs Avatar answered Nov 15 '22 12:11

vhs