Я использую этот файл веб-пакета и получаю сообщение об ошибке.
Это файл веб-пакета:
const path = require('path');
module.exports = {
target: 'node',
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'build')
},
module: {
rules: [
{
test: /\.js?$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: [
'react',
'stage-0',
['env', { targets: { browsers: ['last 2 versions']}}]
]
}
}
]
}
}
это сообщение об ошибке:
Invalid configuration object. Webpack has been initialised using a
configuration object that does not match the API schema.
- configuration.context: The provided value
"C:\\Users\\}\\Desktop\\Node\\HelloWorld!\\new" contains exclamation mark
(!) which is not allowed because it's reserved for loader syntax.
-> The base directory (absolute path!) for resolving the `entry` option. If
`output.pathinfo` is set, the included pathinfo is shortened to this
directory.
- configuration.output.path: The provided value
"C:\\Users\\}\\Desktop\\Node\\HelloWorld!\\new\\build" contains
exclamation mark (!) which is not allowed because it's reserved for loader
syntax.
-> The output directory as **absolute path** (required).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! new@1.0.0 dev:build:server: `webpack --config
webpack.server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the new@1.0.0 dev:build:server 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\}\AppData\Roaming\npm-cache\_logs\2019-01-
08T16_11_48_069Z-debug.log