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

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

剛開始是路徑的問題,現在又是js的問題,太難了

gulpfile

http://img1.sycdn.imooc.com//5aa89d8e0001d42d05730505.jpg

webpack.config.js

http://img1.sycdn.imooc.com//5aa89db0000144c206030654.jpg

package.json

http://img1.sycdn.imooc.com//5aa89dcd0001a6b805410467.jpg

錯誤

http://img1.sycdn.imooc.com//5aa89ddd0001cdfd09660572.jpg

正在回答

3 回答

我的還發生錯誤了呢,求解不知道怎么修改了


webpack 是新版的,用視頻的方法運行錯誤,所以修改如下,

module.exports = {

entry: {

index: './js/index'

},

output: {

filename: '[name].js'

},

resolve: {

extensions: ['.js']

},

module: {

rules: [{

test: /\.js$/,

exclude: /node_modules/,

use: [{

loader: 'babel',

options: {

presets: ['es2015']

}

}]

}]

}

}



錯誤如下:

λ gulp

[18:47:27] Using gulpfile F:\qianduan_dir\00program\JQuery\shudu\src\gulpfile.js

[18:47:27] Starting 'webpack'...

[18:47:32] Finished 'webpack' after 4.83 s

[18:47:32] Starting 'less'...

[18:47:33] Finished 'less' after 771 ms

[18:47:33] Starting 'default'...

[18:47:33] Finished 'default' after 86 μs


internal/streams/legacy.js:59

? ? ? throw er; // Unhandled stream error in pipe.

? ? ? ^

Error: Entry module not found: Error: Can't resolve 'babel' in 'F:\qianduan_dir\00program\JQuery\shudu\src'

BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.

? ? ? ? ? ? ? ? ?You need to specify 'babel-loader' instead of 'babel',

? ? ? ? ? ? ? ? ?see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed

resolve 'babel' in 'F:\qianduan_dir\00program\JQuery\shudu\src'

? Parsed request is a module

? using description file: F:\qianduan_dir\00program\JQuery\shudu\src\package.json (relative path: .)

? ? resolve as module

? ? ? F:\qianduan_dir\00program\JQuery\shudu\node_modules doesn't exist or is not a directory

? ? ? F:\qianduan_dir\00program\JQuery\node_modules doesn't exist or is not a directory

? ? ? F:\qianduan_dir\00program\node_modules doesn't exist or is not a directory

? ? ? F:\node_modules doesn't exist or is not a directory

? ? ? looking for modules in F:\qianduan_dir\node_modules

? ? ? ? No description file found

? ? ? looking for modules in F:\qianduan_dir\00program\JQuery\shudu\src\node_modules

? ? ? ? using description file: F:\qianduan_dir\00program\JQuery\shudu\src\package.json (relative path: ./node_modules)

? ? ? ? ? using description file: F:\qianduan_dir\00program\JQuery\shudu\src\package.json (relative path: ./node_modules/babel)

? ? ? ? ? ? no extension

? ? ? ? ? ? ? F:\qianduan_dir\00program\JQuery\shudu\src\node_modules\babel doesn't exist

? ? ? ? No description file found

? ? ? ? ? ? .js

? ? ? ? ? ? ? F:\qianduan_dir\00program\JQuery\shudu\src\node_modules\babel.js doesn't exist

? ? ? ? no extension

? ? ? ? ? F:\qianduan_dir\node_modules\babel doesn't exist

? ? ? ? ? ? .json

? ? ? ? ? ? ? F:\qianduan_dir\00program\JQuery\shudu\src\node_modules\babel.json doesn't exist

? ? ? ? .js

? ? ? ? ? F:\qianduan_dir\node_modules\babel.js doesn't exist

? ? ? ? ? ? as directory

? ? ? ? ? ? ? F:\qianduan_dir\00program\JQuery\shudu\src\node_modules\babel doesn't exist

? ? ? ? .json

? ? ? ? ? F:\qianduan_dir\node_modules\babel.json doesn't exist

? ? ? ? as directory

? ? ? ? ? F:\qianduan_dir\node_modules\babel doesn't exist


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

解決了,謝謝,我的天,不仔細害死人啊

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

presets?少了個s啊,大兄弟

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

舉報

0/150
提交
取消

剛開始是路徑的問題,現在又是js的問題,太難了

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

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

幫助反饋 APP下載

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

公眾號

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