我的webpack.config.js文件代码为:
const path = require('path');
module.exports = {
entry: './src/js/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
mode: 'development'
};
package.json文件:
"name": "forkify",
"version": "1.0.0",
"description": "forkify project",
"main": "index.js",
"scripts": {
"dev": "webpack"
},
"author": "Parichay Pari",
"license": "ISC",
"devDependencies": {
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11"
},
"dependencies": {}
}
我得到的错误是:
参数数量不足或找不到条目。
npm ERR!代码ELIFECYCLE
npm ERR!错误2
npm ERR! forkify@1.0.0开发人员:webpack
npm ERR!退出状态2
npm ERR!
npm ERR!在forkify@1.0.0开发脚本处失败。
npm ERR! npm可能不是问题。上面可能还有其他日志记录输出。
npm ERR!可以在以下位置找到此运行的完整日志: npm ERR! /home/parichay/.npm/_logs/2020-03-08T05_08_19_681Z-debug.log