Getting error when running npm run build
:
Can any one help me to fix this issue.
Package.json file:
{
"name": "confusion",
"version": "1.0.0",
"description": "This is a website for Ristorante Con Fusion",
"main": "index.html",
"scripts": {
"start": "npm run watch:all",
"test": "echo \"Error: no test specified\" && exit 1",
"lite": "lite-server",
"scss": "node-sass -o css/ css/",
"watch:scss": "onchange \"css/*.scss\" -- npm run scss",
"watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\"",
"clean": "rimraf dist",
"copyfonts": "copyfiles -f node_modules/font-awesome/fonts/* dist/fonts",
"imagemin": "imagemin img/* --out-dir=dist/img",
"usemin": "usemin contactus.html -d dist --htmlmin -o dist/contactus.html && usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html && usemin index.html -d dist --htmlmin -o dist/index.html",
"build": "npm run clean && npm run imagemin && npm run copyfonts && npm run usemin"
},
"author": "",
"license": "ISC",
"devDependencies": {
"cssmin": "^0.4.3",
"htmlmin": "0.0.7",
"lite-server": "^2.5.4",
"micromatch": "^4.0.2",
"node-sass": "^4.14.1",
"onchange": "^3.3.0",
"parallelshell": "^3.0.1",
"rimraf": "^2.6.2",
"uglify-js": "^3.11.6",
"usemin-cli": "^0.6.0"
},
"dependencies": {
"bootstrap": "^4.0.0",
"bootstrap-social": "^5.1.1",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"popper.js": "^1.12.9"
}
}
ERROR
PS I:\Projects\Bootstrtao-test> npm run build
> [email protected] build I:\Projects\Bootstrtao-test
> npm run clean && npm run imagemin && npm run copyfonts && npm run usemin
> [email protected] clean I:\Projects\Bootstrtao-test
> rimraf dist
> [email protected] imagemin I:\Projects\Bootstrtao-test
> imagemin img/* --out-dir=dist/img
4 images minified
> [email protected] copyfonts I:\Projects\Bootstrtao-test
> copyfiles -f node_modules/font-awesome/fonts/* dist/fonts
> [email protected] usemin I:\Projects\Bootstrtao-test
> usemin contactus.html -d dist --htmlmin -o dist/contactus.html && usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html && usemin index.html -d dist --htmlmin -o dist/index.html
I:\Projects\Bootstrtao-test\node_modules\usemin\lib\processBlocks.js:39
throw Error('Unsupport format: ' + block.type);
^
Error: Unsupport format: CSS
at I:\Projects\Bootstrtao-test\node_modules\usemin\lib\processBlocks.js:39:10
at Array.forEach (<anonymous>)
at module.exports (I:\Projects\Bootstrtao-test\node_modules\usemin\lib\processBlocks.js:9:9)
at usemin (I:\Projects\Bootstrtao-test\node_modules\usemin\usemin.js:27:42)
at Object.<anonymous> (I:\Projects\Bootstrtao-test\node_modules\usemin-cli\index.js:52:12)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] usemin: `usemin contactus.html -d dist --htmlmin -o dist/contactus.html && usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html && usemin index.html -d dist --htmlmin -o dist/index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] usemin script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PetrosBelachew\AppData\Roaming\npm-cache\_logs\2020-11-20T12_05_10_237Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npm run clean && npm run imagemin && npm run copyfonts && npm run usemin`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PetrosBelachew\AppData\Roaming\npm-cache\_logs\2020-11-20T12_05_10_452Z-debug.log
Any ideas on how to fix this?
I have fixed the issue by myself,after observing the error above(Error: Unsupport format: CSS).Then checked my index.html file,that the code like this
<!--build:CSS CSS/main.css-->
.....
<!--endbuild-->
on this line above,you can see that CSS has to be lower case css.After that I have solved other issues within my HTML file.Then the build was successful.