Skip to content
Advertisement

Parcel bundler “ENOENT: no such file or directory” when delete files from project

After I’ve deleted couple files from project that uses Parcel bundler, command parcel ./index.html started to output following error:

JavaScript

Advertisement

Answer

Solution

Delete .parcel-cache and dist folders and run command again. (NB: The cache folder was called just .cache in version 1.x of Parcel.)

Proposal

Add cleanup script for this and run it each time before parcel build:

JavaScript

Also you can use rimraf lib to do a crossplatform cleanup task. https://www.npmjs.com/package/rimraf. So scripts will look like this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement