ashToronto
ashToronto

Reputation: 45

Used yarn to add cors but there is an error

I am facing this issue:

error An unexpected error occurred: "/home/vagrant/.cache/yarn/v1/npm-cors-2.8.4-2bd381f2eb201020105cd50ea59da63090694686/.yarn-metadata.json: Unexpected end of JSON input".

A few things to note:

  1. During the installation of cors (yarn add cors), my laptop died on battery.

  2. The cors files are there in node modules but aren't listed in package.json.

  3. I recently switched from npm to yarn and operate within vagrant VM.

  4. Tried to delete files from node modules but id didn't make a difference

yarn remove cors gives this error:

error This module isn't specified in a manifest.

Upvotes: 1

Views: 3329

Answers (1)

Oleksandr Kovpashko
Oleksandr Kovpashko

Reputation: 800

Seems like you've got broken yarn cache. Execute yarn cache clean and retry module installation.

Upvotes: 2

Related Questions