Install WeChat applet development tools on linux system

1. First, install
           the nw.js sdk environment nw.js installation:
    1. The first is to install under osx. You can refer to the official documentation to download the app and then set the path, or you can directly install it in one step with one command!
       The premise is to install the node.js environment first, and then enter the command directly under the terminal:    

sudo npm install -g nw

       Install the nw module globally under administrator privileges, wait a long time for the installation and compilation to complete, and then directly enter the nw command to use it.
    2. Then there is the installation under ubuntu, like osx, because node.js is installed in the system, so it is also a command to install and compile directly:

sudo npm install -g nw
nw.

       The same is true in other linux desktop systems. If the node.js environment is not installed, then download the compressed package directly from the official website and refer to the documentation to install it!
            In addition, you can also go to the official website to download the nwjs installation package, unzip the package, and run the nw file inside to start the nw environment.
            Note that the running command for npm command installation is nw or nw., and the startup command for downloading and decompressing the installation package is ./nw
    3. Then there is the Windows, this simple can be ignored, directly download the program compression package on the official website, and then extract it to the C drive program directory (Program Files).
       So, how do we run nw.js? Right-click the nw.exe shortcut icon to the desktop, or directly customize the suffix of your own application and select nw.js to open it!
    2. Configure environment variables
    export PATH=$PATH:nw installation path, if you do not know the installation path, you can pass
    witch nw find

    Such as:

export PATH=$PATH:/opt/au1200_rm/build_tools/bin

    To check whether it has been set, you can use the command export to check:
    export

    3. Next, extract the package.nw file of the WeChat applet development tool, which is the project package file of nwjs. Find a window machine to install the applet development tool, find the package.nw folder, icon.ico file, WeChat web developer tool.exe file in the installation directory, and copy these three files to the nwjs installation directory under the linux system Down. Logically speaking, enter this folder nw . and you can run it, but you will find an error, because Tencent's developers do not distinguish between upper and lower case file references in the project, it can run on windows, but not on linux. Knowing the reason, we will correct the citation errors. Execute in the package.nw directory:

nw.
or
./nw

    According to the error message, modify the capitalization, and then you can open the applet development tool normally. If the "failed to load..." error message is displayed when opening, it is because the icon file cannot be loaded. You can edit the "icon" in package.json: "app/images/logo2.png" as another ico file or just delete this line.


    In addition, https://github.com/yuan1994/wechat_web_devtools, the git clone here is also possible, but I cloned it for several hours, and I gave up if I didn't clone it.


    4. Download wine

    Mine is fedora 32, install it with the following command

 sudo dnf install wine.x86_64


        If it is ubuntu, you can install it with the following command:

sudo apt-get install wine


        Then modify the wcc.exe file

        , modify the file names of wcc.exe and wcsc.exe, and remove .exe.

            The command line operation code is as follows:

 cd ./config/微信web开发者工具/WeappVendor
 cp wcc.exe wcc
 cp wcsc.exe wcsc

        Go to the package.nw/app/dist/weapp/ folder, find commit/build.js, trans/transWxmlToJs.js and utils/vendorManager.js, and change the wcc.exe and wcsc.exe in the code to wcc and wcsc .

    After the installation is complete, restart nw



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324345389&siteId=291194637