Mendapatkan kesalahan saat menjalankan npm run build: Adakah yang bisa membantu saya untuk memperbaiki masalah ini.

File package.json:

{
  "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"
  }
}

KESALAHAN

PS I:\Projects\Bootstrtao-test> npm run build

> confusion@1.0.0 build I:\Projects\Bootstrtao-test
> npm run clean && npm run imagemin && npm run copyfonts && npm run usemin


> confusion@1.0.0 clean I:\Projects\Bootstrtao-test
> rimraf dist


> confusion@1.0.0 imagemin I:\Projects\Bootstrtao-test
> imagemin img/* --out-dir=dist/img

4 images minified

> confusion@1.0.0 copyfonts I:\Projects\Bootstrtao-test
> copyfiles -f node_modules/font-awesome/fonts/* dist/fonts


> confusion@1.0.0 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! confusion@1.0.0 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 confusion@1.0.0 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! confusion@1.0.0 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 confusion@1.0.0 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

Adakah ide tentang cara memperbaikinya?

0
Petros Belachew 20 November 2020, 15:21

1 menjawab

Jawaban Terbaik

Saya telah memperbaiki masalah sendiri, setelah mengamati kesalahan di atas (Kesalahan: Format tidak mendukung: CSS). Kemudian periksa file index.html saya, bahwa kodenya seperti ini

<!--build:CSS CSS/main.css-->
   .....
 <!--endbuild-->

Pada baris di atas ini, Anda dapat melihat bahwa CSS harus huruf kecil css. Setelah itu saya telah memecahkan masalah lain dalam file HTML saya. Kemudian build berhasil.

0
Petros Belachew 9 Februari 2021, 13:49