1

在此处输入图像描述

这是我得到的错误

F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4>npm run build

混淆@1.0.0 build F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4

npm run clean && npm run imagemin && npm run copyfonts && npm run usemin1 && npm run usemin2 && npm run usemin3

混淆@1.0.0 clean F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4

边缘区

混淆@1.0.0 imagemin F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4

imagemin img/* -o dist/img

4 图像缩小

混淆@1.0.0 copyfonts F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4

复制文件 -f node_modules/font-awesome/fonts/* dist/fonts

混淆@1.0.0 usemin1 F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4

usemin contactus.html -d dist --htmlmin -o dist/contactus.html

混淆@1.0.0 usemin2 F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4

使用min aboutus.html -d dist --htmlmin -o dist/aboutus.html

undefined:1623

throw new JS_Parse_Error(message, filename, line, col, pos);

^

JS_Parse_Error [SyntaxError]: Unexpected token name «o», expected punc «;»

at JS_Parse_Error.get (eval at <anonymous> (F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4\node_modules\usemin\node_modules\uglify-js\tools\node.js:27:1), <anonymous>:84:23)

at formatError (internal/util/inspect.js:1079:38)

at formatRaw (internal/util/inspect.js:883:14)

at formatValue (internal/util/inspect.js:737:10)

at inspect (internal/util/inspect.js:280:10)

at afterInspector (internal/errors.js:686:14) {

message: 'Unexpected token name «o», expected punc «;»',

filename: 'node_modules\\popper.js\\dist\\popper.min.js',

line: 4,

col: 161,

pos: 294

}

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! confusion@1.0.0 usemin2: `usemin aboutus.html -d dist --htmlmin -o dist/aboutus.html`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the confusion@1.0.0 usemin2 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\Jitesh\AppData\Roaming\npm-cache\_logs\2020-06-10T05_05_10_690Z-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 usemin1 && npm run usemin2 && npm run usemin3`

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\Jitesh\AppData\Roaming\npm-cache\_logs\2020-06-10T05_05_10_723Z-debug.log

在此处输入图像描述

我的 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/* -o 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": "Jitesh Kumar",
  "license": "ISC",
  "devDependencies": {
    "cssmin": "^0.4.3",
    "htmlmin": "0.0.7",
    "lite-server": "^2.3.0",
    "node-sass": "^4.14.1",
    "onchange": "^3.3.0",
    "parallelshell": "^3.0.1",
    "rimraf": "^2.6.2",
    "uglify-js": "^3.9.4",
    "uglifyjs": "^2.4.11",
    "usemin-cli": "^0.6.0"
  },
  "dependencies": {
    "@popperjs/core": "^2.1.0",
    "bootstrap": "^4.4.1",
    "bootstrap-social": "^5.1.1",
    "font-awesome": "^4.7.0",
    "gulp-util": "^3.0.8",
    "jquery": "^3.5.1",
    "popper.js": "^1.16.1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jiteshkrs97/HongKongBootstrap.git"
  },
  "bugs": {
    "url": "https://github.com/jiteshkrs97/HongKongBootstrap/issues"
  },
  "homepage": "https://github.com/jiteshkrs97/HongKongBootstrap#readme"
}
4

0 回答 0