亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

webpack hello.js hello.bundle.js 報錯


$ webpack hello.js hello.bundle.js

C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js:244

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? throw err;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^


TypeError: Cannot read property 'length' of undefined

? ? at processConfiguredOptions (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\bin\convert-argv.js:160:44)

? ? at module.exports (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\bin\convert-argv.js:148:10)

? ? at yargs.parse (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js:241:39)

? ? at Object.parse (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\[email protected]@yargs\yargs.js:552:18)

? ? at C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js:219:8

? ? at Object.<anonymous> (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js:530:3)

? ? at Module._compile (internal/modules/cjs/loader.js:778:30)

? ? at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

? ? at Module.load (internal/modules/cjs/loader.js:653:32)

? ? at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

? ? at Function.Module._load (internal/modules/cjs/loader.js:585:3)

? ? at Module.require (internal/modules/cjs/loader.js:692:17)

? ? at require (internal/modules/cjs/helpers.js:25:18)

? ? at runCli (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:54:2)

? ? at Object.<anonymous> (C:\Users\yu\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:147:2)

? ? at Module._compile (internal/modules/cjs/loader.js:778:30)

? ? at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

? ? at Module.load (internal/modules/cjs/loader.js:653:32)

? ? at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

? ? at Function.Module._load (internal/modules/cjs/loader.js:585:3)

? ? at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)

? ? at startup (internal/bootstrap/node.js:283:19)

? ? at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)


正在回答

2 回答

?webpack ./hello.js --output-path ./ --output-filename bundle.js --mode development

搜索

復制

0 回復 有任何疑惑可以回復我~
#1

weixin_慕斯1009030

這個是5.64.1版本的命令
2021-11-16 回復 有任何疑惑可以回復我~
#2

qq_甲骨文_3

你好,能否請教一下Error: Unknown option '--module-bind'這個如果要轉換成新語法的方法,我搜索了半天都沒找到
2022-01-17 回復 有任何疑惑可以回復我~
webpack新版本不支持,建議在目錄下加個webpack.config.js文件
const?path?=?require('path');module.exports?=?{??entry:?'./hello.js',??mode:?'development',??output:?{????filename:?'hello.bundle.js',????path:?path.resolve(__dirname)??},};

然后運行?webpack就可以了


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

webpack hello.js hello.bundle.js 報錯

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號