課程
/前端開發(fā)
/前端工具
/Vue+Webpack打造todo應(yīng)用
2018-06-28
源自:Vue+Webpack打造todo應(yīng)用 2-1
正在回答
還是不行
> shizhan-vue@1.0.0 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):
按照大神的方法出現(xiàn)了這個(gè)問題,是什么原因怎么破?我試著安裝了webpack-cli后報(bào)以下錯(cuò)誤
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN shizhan-vue@1.0.0 No description
npm WARN shizhan-vue@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ webpack-cli@3.1.0
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! shizhan-vue@1.0.0 build: `webpack --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the shizhan-vue@1.0.0 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_天涼好個(gè)秋_14
幕布斯6436195 回復(fù) qq_天涼好個(gè)秋_14
qianjunyifa
厲害了,問題已經(jīng)解決
可以,已解決
這個(gè)可以,已解決。
是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 回復(fù) wason
qq_情融化了雪_0
YeeTodd 回復(fù) weibo_姚望微晨_0
慕斯卡拉
40huo
Terence_Jing 回復(fù) wason
iOS_侯陽陽
舉報(bào)
用前端最熱門框架Vue+最火打包工具Webpack打造todo應(yīng)用
2 回答運(yùn)行npm run build 報(bào)錯(cuò)怎么解決啊
2 回答npm run build 報(bào)錯(cuò)
1 回答npm run build 報(bào)錯(cuò)
3 回答npm run build 報(bào)錯(cuò)
3 回答npm run build報(bào)錯(cuò)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-12-12
還是不行
2018-08-06
> shizhan-vue@1.0.0 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):
按照大神的方法出現(xiàn)了這個(gè)問題,是什么原因怎么破?我試著安裝了webpack-cli后報(bào)以下錯(cuò)誤
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN shizhan-vue@1.0.0 No description
npm WARN shizhan-vue@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ webpack-cli@3.1.0
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! shizhan-vue@1.0.0 build: `webpack --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the shizhan-vue@1.0.0 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
厲害了,問題已經(jīng)解決
2018-07-20
可以,已解決
2018-07-12
這個(gè)可以,已解決。
是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()
]