1.管理员身份运行vscode,避免无权限执行脚本的冲突问题
2.执行命令
(1)npm init
(2)npm install webpack webpack-cli -g
(3)npm install webpack webpack-cli -D
PS D:\Webpack> cd 01webpack
PS D:\Webpack\01webpack> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (01webpack) webpack_test
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to D:\Webpack\01webpack\package.json:
{
"name": "webpack_test",
"version": "1.0.0",
"description": "",
"main": "index.