简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM