ChrisP
ChrisP

Reputation: 10116

Dependency problem with vue-cli-service serve

When I try to build my VueJS typescript app I get the following dependency errors.

vue-cli-service serve

INFO Starting development server... Starting type checking and linting service... Using 1 worker with 2048MB memory limit 98% after emitting CopyPlugin

ERROR Failed to compile with 5 errors 9:05:52 PM These dependencies were not found:

To install them, you can run: npm install --save core-js/modules/es6.function.name core-js/modules/es6.string.includes core-js/modules/es6.typed.uint8-array core-js/modules/es7.array.includes core-js/modules/web.dom.iterable No type errors found No lint errors found Version: typescript 3.5.2, tslint 5.17.0

Then when I run the suggested npm command at the end of the error list I get the following error.

npm install --save core-js/modules/es6.function.name core-js/modules/es6.string.includes core-js/modules/es6.typed.uint8-array core-js/modules/es7.array.includes core-js/modules/web.dom.iterable npm ERR! code ENOLOCAL npm ERR! Could not install from "core-js\modules\es6.function.name" as it does not contain a package.json file.

Upvotes: 6

Views: 17930

Answers (2)

Admiral Potato
Admiral Potato

Reputation: 110

I've read several places that installing core-js will solve the problem, but installing that just by name will get you core-js@3 at the moment, and v3 is still only half baked and/or incompatible with the way that it's being used by the Vue CLI/Babel/Webpack tools. Specifically installing core-js@2 seems to fix the issue we're having. This is what got it the vue serve command working for me again on new, as well as existing projects:

npm install --save-dev @vue/cli @vue/cli-service-global core-js@2

Good luck!

Upvotes: 2

Lukas
Lukas

Reputation: 1123

npm add core-js did the trick for me :)

Upvotes: 2

Related Questions