課程
/前端開發
/前端工具
/Vue+Webpack打造todo應用
2018-06-28
源自:Vue+Webpack打造todo應用 2-1
正在回答
還是不行
> [email protected] build E:\web前段\shizhan-vue
> webpack --mode development
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
?- webpack-cli (https://github.com/webpack/webpack-cli)
? ?The original webpack full-featured CLI.
?- webpack-command (https://github.com/webpack-contrib/webpack-command)
? ?A lightweight, opinionated webpack CLI.
We will use "npm" to install the CLI via "npm install -D".
Which one do you like to install (webpack-cli/webpack-command):
按照大神的方法出現了這個問題,是什么原因怎么破?我試著安裝了webpack-cli后報以下錯誤
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ [email protected]
added 76 packages in 54.02s
TypeError: path.jion is not a function
? ? at Object.<anonymous> (E:\web前段\shizhan-vue\webpack.config.js:6:12)
? ? at Module._compile (E:\web前段\shizhan-vue\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
? ? at Object.Module._extensions..js (module.js:663:10)
? ? at Module.load (module.js:565:32)
? ? at tryModuleLoad (module.js:505:12)
? ? at Function.Module._load (module.js:497:3)
? ? at Module.require (module.js:596:17)
? ? at require (E:\web前段\shizhan-vue\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
? ? at WEBPACK_OPTIONS (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:133:13)
? ? at requireConfig (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:135:6)
? ? at E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:142:17
? ? at Array.forEach (<anonymous>)
? ? at module.exports (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:140:15)
? ? at yargs.parse (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\cli.js:241:39)
? ? at Object.parse (E:\web前段\shizhan-vue\node_modules\yargs\yargs.js:563:18)
? ? at E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\cli.js:219:8
? ? at Object.<anonymous> (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\cli.js:530:3)
? ? at Module._compile (module.js:652:30)
? ? at require (internal/module.js:11:18)
? ? at runCommand.then (E:\web前段\shizhan-vue\node_modules\webpack\bin\webpack.js:152:5)
? ? at <anonymous>
? ? at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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\2018-08-06T08_48_54_669Z-debug.log
qq_天涼好個秋_14
幕布斯6436195 回復 qq_天涼好個秋_14
qianjunyifa
厲害了,問題已經解決
可以,已解決
這個可以,已解決。
是webpack升級到4以后的問題
可以,解決了
1,修改package.json中代碼
將老師編輯的?
"build": "webpack --config webpack.config.js"
修改為
"build": "webpack --mode development"
2,修改webpack.config.js中代碼
頂部添加
const {
VueLoaderPlugin
} = require('vue-loader');
將【module】中新增【css】以及末尾添加【plugins】
修改為:
module: {
rules: [{
test: /.vue$/,
loader: 'vue-loader'
}, {
test: /.css$/,
use: ['vue-style-loader', 'css-loader']
}]
},
plugins: [
new VueLoaderPlugin()
]
wason
weibo_姚望微晨_0 回復 wason
qq_情融化了雪_0
YeeTodd 回復 weibo_姚望微晨_0
慕斯卡拉
40huo
Terence_Jing 回復 wason
iOS_侯陽陽
舉報
用前端最熱門框架Vue+最火打包工具Webpack打造todo應用
2 回答運行npm run build 報錯怎么解決啊
2 回答npm run build報錯
2 回答npm run build 報錯
1 回答npm run build報錯
4 回答npm run build報錯
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-12-12
還是不行
2018-08-06
> [email protected] build E:\web前段\shizhan-vue
> webpack --mode development
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
?- webpack-cli (https://github.com/webpack/webpack-cli)
? ?The original webpack full-featured CLI.
?- webpack-command (https://github.com/webpack-contrib/webpack-command)
? ?A lightweight, opinionated webpack CLI.
We will use "npm" to install the CLI via "npm install -D".
Which one do you like to install (webpack-cli/webpack-command):
按照大神的方法出現了這個問題,是什么原因怎么破?我試著安裝了webpack-cli后報以下錯誤
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ [email protected]
added 76 packages in 54.02s
TypeError: path.jion is not a function
? ? at Object.<anonymous> (E:\web前段\shizhan-vue\webpack.config.js:6:12)
? ? at Module._compile (E:\web前段\shizhan-vue\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
? ? at Object.Module._extensions..js (module.js:663:10)
? ? at Module.load (module.js:565:32)
? ? at tryModuleLoad (module.js:505:12)
? ? at Function.Module._load (module.js:497:3)
? ? at Module.require (module.js:596:17)
? ? at require (E:\web前段\shizhan-vue\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
? ? at WEBPACK_OPTIONS (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:133:13)
? ? at requireConfig (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:135:6)
? ? at E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:142:17
? ? at Array.forEach (<anonymous>)
? ? at module.exports (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\convert-argv.js:140:15)
? ? at yargs.parse (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\cli.js:241:39)
? ? at Object.parse (E:\web前段\shizhan-vue\node_modules\yargs\yargs.js:563:18)
? ? at E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\cli.js:219:8
? ? at Object.<anonymous> (E:\web前段\shizhan-vue\node_modules\webpack-cli\bin\cli.js:530:3)
? ? at Module._compile (module.js:652:30)
? ? at Object.Module._extensions..js (module.js:663:10)
? ? at Module.load (module.js:565:32)
? ? at tryModuleLoad (module.js:505:12)
? ? at Function.Module._load (module.js:497:3)
? ? at Module.require (module.js:596:17)
? ? at require (internal/module.js:11:18)
? ? at runCommand.then (E:\web前段\shizhan-vue\node_modules\webpack\bin\webpack.js:152:5)
? ? at <anonymous>
? ? at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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\2018-08-06T08_48_54_669Z-debug.log
2018-07-26
厲害了,問題已經解決
2018-07-20
可以,已解決
2018-07-12
這個可以,已解決。
是webpack升級到4以后的問題
2018-07-10
可以,解決了
2018-06-28
1,修改package.json中代碼
將老師編輯的?
"build": "webpack --config webpack.config.js"
修改為
"build": "webpack --mode development"
2,修改webpack.config.js中代碼
頂部添加
const {
VueLoaderPlugin
} = require('vue-loader');
將【module】中新增【css】以及末尾添加【plugins】
修改為:
module: {
rules: [{
test: /.vue$/,
loader: 'vue-loader'
}, {
test: /.css$/,
use: ['vue-style-loader', 'css-loader']
}]
},
plugins: [
new VueLoaderPlugin()
]