刚开始是路径的问题,现在又是js的问题,太难了
gulpfile
webpack.config.js
package.json
错误
gulpfile
webpack.config.js
package.json
错误
2018-03-14
我的还发生错误了呢,求解不知道怎么修改了
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
举报