安装miniprogram-cli
1F:\business-system\weixin-app-order>npm install -g @wechat-miniprogram/miniprogram-cli 2npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. 3npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported 4npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me 5 6added 180 packages in 38s 7 820 packages are looking for funding 9 run `npm fund` for details 10 11
验证安装
1F:\business-system\weixin-app-order>miniprogram --help 2Usage: cli [options] [command] 3 4Options: 5 -V, --version output the version number 6 -h, --help output usage information 7 8Commands: 9 init [options] [dirPath] create a project with template project 10 upgrade [options] [dirPath] upgrade the miniprogram custom component framwork 11 cache [options] show the path of template projects cache 12 13F:\business-system\weixin-app-order>miniprogram -V 140.0.7 15F:\business-system\weixin-app-order>miniprogram init --help 16Usage: init [options] [dirPath] 17 18create a project with template project 19 20Options: 21 -t, --type <type> template project type, only accept "custom-component", "miniprogram", "plugin", "game" 22 -f, --force all files will be overrided whether it already exists or not 23 -p, --proxy <url> http/https request proxy 24 -n, --newest use newest template to initialize project 25 -h, --help output usage information 26
初始化微信小程序
1 2miniprogram init --type miniprogram . --newest 3 4