search
HomeWeChat AppletMini Program DevelopmentIntroduction to Linux development environment settings for WeChat mini programs

This article mainly introduces the relevant information on the detailed explanation of the WeChat Mini Program Linux development environment settings. Friends in need can refer to

WeChat Mini Program Linux Development Environment

WeChat applet development tool is implemented using nw.js, which is inherently cross-platform. I don’t understand why WeChat only has Windows and Mac versions. Today I messed around a bit and can develop WeChat applets under Linux. Take ubuntu as an example:

First, you need to install the nwjs sdk environment. Because you need devtool support, you must install the sdk version.

Download the nwjs sdk compressed package and unzip it to your favorite location, and set the environment variables. The nw executable file is added to the path variable.

The next step is to extract the package.nw file of the WeChat applet development tool. This is the project package file of nwjs. Find a window machine to install the small program development tool, find the package.nw folder in the installation directory, and copy the folder to the Linux system. Logically speaking, you can run it by entering this folder nw., but you will find that an error is reported, because Tencent developers do not distinguish between upper and lower case in the project file references, so it can run on Windows, but not on Linux. Knowing the reason, we will correct the citation error. Execute in the package.nw directory:


sed -i 's/\.\/Create\/create\.js/\.\/create\/create\.js/ig' app/dist/components/ContainController.js
sed -i 's/\.\/main\.js/\.\/Main\.js/ig' app/dist/components/ContainController.js
sed -i 's/\.\/webview\/Picker/\.\/webview\/picker/ig' app/dist/components/simulator/controller.js
sed -i 's/\.\/webview\/ActionSheet\.js/\.\/webview\/actionSheet\.js/ig' app/dist/components/simulator/controller.js
sed -i 's/appServiceConfig\.js/appserviceConfig\.js/ig' app/dist/common/assdk/networkSdk.js

After the execution is completed, enter the directory:


##

nw .

You can open the small file normally If the program development tool prompts "failed to load..." when opening it, it is because the icon file cannot be loaded. You can edit "icon": "app/images/logo2.png" in package.json to another ico file or delete this line directly.

Supplement:

need npm install before running nw.


I still need to install several modules separately locally:



npm install --save autoprefixer
npm install --save pretty
npm install --save perfectionist

Thank you for reading, I hope it can help everyone, thank you for your support Support from this site!

The above is the detailed content of Introduction to Linux development environment settings for WeChat mini programs. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor