Learn to build WeChat applet and official account application development environment on Ubuntu 18.04

coldplay.xixi
Release: 2020-08-17 16:43:29
forward
4481 people have browsed it

Learn to build WeChat applet and official account application development environment on Ubuntu 18.04

[Related learning recommendations: WeChat Mini Program Development Tutorial]

Build a development environment for WeChat mini programs and public account applications on Ubuntu 18.04

Install NVM

If you used apt-get to install Node.js on Ubuntu, you need to remove it manually first:

$ sudo apt-get purge nodejs && sudo apt-get autoremove && sudo apt-get autoclean
Copy after login

Install NVM: After

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
Copy after login

or

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
Copy after login

is installed, add the following code to ~/.bash_profile, ~/.zshrc, ~ /.profile, or ~/.bashrc:

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Copy after login

Test:

在Ubuntu 18.04上 搭建微信小程序和公众号应用开发环境

## Use Taobao mirror

export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
Copy after login
NVM Common Instructions

View all Node.js versions available locally

$ nvm list
Copy after login

View those available on the server Node.js version

$ nvm ls-remote
Copy after login
*

Install `8.` LTS version (long-term maintenance version) **

$ nvm install 8.16.2
Copy after login

Set the default version

$ nvm use  8.16.2
$ nvm alias default  8.16.2
Copy after login

Use Taobao to accelerate NPM

$ npm config set registry=https://registry.npm.taobao.org
Copy after login

Update NPM to the latest

$ npm install -g npm
Copy after login

Detection version

$ npm -v
Copy after login
Install Yarn

First method: Install Stable version 1.19.1

Configure warehouse:

url -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Copy after login
Installation:

sudo apt-get update && sudo apt-get install --no-install-recommends yarn
Copy after login
Second method: Install

npm install --global yarn
Copy after login
through npm and then set the PATH environment variable in the terminal (that is, add the following code to

~/ .bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc)

export PATH="$PATH:`yarn global bin`"
Copy after login
Finally run the command Test whether Yarn is successfully installed:

yarn --version
Copy after login

在Ubuntu 18.04上 搭建微信小程序和公众号应用开发环境

Install Linux WeChat web developer tools

Download project and initialization

git clone https://github.com/cytle/wechat_web_devtools.git
cd wechat_web_devtools
# 自动下载最新 `nw.js` , 同时部署目录 `~/.config/wechat_web_devtools/`
./bin/wxdt install
Copy after login

Install Wine

sudo apt-get install wine-binfmt
sudo update-binfmts --import /usr/share/binfmts/wine
Copy after login

Start ide, develop and debug web pages

./bin/wxdt # 启动
Copy after login

在Ubuntu 18.04上 搭建微信小程序和公众号应用开发环境

Basic environment for small programs Build

Install wepy-ci

WePY is a component-based development framework for small programs. The development style is close to Vue.js and closer to the MVVM architecture model. Compared with small programs Native development of programs is more convenient and faster.

yarn global add wepy-cli
Copy after login

Initialize the project

mkdir helloworld
cd helloworld 
helloworld  wepy init standard ./
Copy after login

在Ubuntu 18.04上 搭建微信小程序和公众号应用开发环境

Compile the project and continue to monitor code changes**

wepy build --watch
Copy after login

在Ubuntu 18.04上 搭建微信小程序和公众号应用开发环境

Related learning recommendations:

WeChat public account development tutorial

The above is the detailed content of Learn to build WeChat applet and official account application development environment on Ubuntu 18.04. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template