有几个问题无法运行,花了几个小时终于成功启动了

作者: edersson520创建于 2023年10月23日更新于 2024年12月18日

The problems I encountered and the solution process (October 24, 2023): 1. Install git and npm locally. 2. Clone or download the zip file, and set the default root directory to miniprogram-demo. All subsequent operations are performed in the root directory. The miniprogram subdirectory looks tempting, but you do not need to do any operations or execute any commands in this or any other subdirectory. 3. Open the WeChat Developer Toolbox, go to the Mini Program->Import section, and set the import directory to the root directory. Use the test number for the appID. After importing, there will be unexpected errors. Ignore them for now. 4. (Important) Open package.json in the root directory and change "@Tencent/eslint-config-wxapp": "^0.5.2" to "eslint-config-wxapp": "^1.0.0". 5. (Important) Open .gitmodules in the root directory and change the url=xxx line in the [submodule "miniprogram/packageSkylineExamples"] item to url = https://GitHub.com/wechat-miniprogram/awesome-skyline.git. 6. (Important) Run the command npm run init --legacy-peer-deps in the root directory. Do not use the official npm run init command. There will be a lot of errors. 7. Go back to the WeChat Developer Toolbox, go to Tools->Build npm, and wait a while. The interface should appear. 8. After I opened the interface, I encountered a white screen with only the tabbar and no content. I tried two times, and switched to the high version (3.1.3) of the Debug Base Library by going to Details->Local Settings->Debug Base Library in the upper right corner. There is a prompt in the console: "Skyline rendering mode is supported in 2.29.2 and above base libraries. balabala .." There is a link to switch the mode, and it is now running normally.

内容来源: wechat-miniprogram/miniprogram-demo