Я получил эту ошибку, когда я пишу «npm start», но я не знаю, почему она дает мне ошибку любому, кто знает эту проблему?webpack.js Я получил новейшее обновление для них
module: {
^
SyntaxError: Unexpected token :
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at WEBPACK_OPTIONS (/var/www/html/nivus/node_modules/webpack-cli/bin/convert-argv.js:133:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nivus@0.1.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nivus@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
вот мой package.json Я не пропустил ни одного,
{
"name": "nivus",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-scripts": "1.1.5"
},
"scripts": {
"start": "webpack-dev-server",
"dev": "webpack --mode development --progress",
"build": "webpack --mode production --progress"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/helper-explode-class": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"babel-core": "^6.26.3",
"babel-loader": "^8.0.4",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"html-webpack-plugin": "^4.0.0-beta.1",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.9"
}
}
вот мой webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.export = {
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
},
plugins: [
new HtmlWebpackPlugin()
]
}