Search code examples
htmlcssterminalweb-frontend

parcel-bundler won't install


new to web development and came across this error message while trying to build for production in the terminal.

Tried entering: parcel build index.html

Error message I get:

🚨 Build failed.

@parcel/namer-default: Target "main" declares an output file path of "index.js" which does not match the compiled bundle type "html".

Not sure what this means since I am still learning. Any help would be appreciative. Thank you in advance.


Solution

  • I literally just found a solution after posting this question.

    So I went inside, "package.json", file and cleared the "main": "index.js", and tried building the parcel again in terminal and it worked. Maybe the problem was the, "main": "index.js", had a 'index.js' and my index was in .html. So after clearing the,"main": "index.js", solved my problem.