Detailed explanation of common problems in building stf on Mac-2023

In the process of building stf, I encountered many problems and spent a lot of time. I hope this article can help you.

mac build stf tutorial guide Mac build stf tutorial-2023_Vermouth_00's blog-CSDN blog

Table of contents

1. Before installing nvm, you need to ensure that there are no node and npm on the computer. How to completely uninstall node on mac

2. Execute sudo npm uninstall npm -g, prompt env: node: No such file or directory

3. When installing and configuring nvm, an environment variable is added to the .bash_profile in the root directory, but the execution of the nvm command still fails, prompting: nvm: command not found

4. An error is reported when installing rethinkdb: Error: rethinkdb: no bottle available

5. Failed to start rethinkdb, port 8080 is occupied

6. Configure environment variables and report an error when operating .bash_profile: Found a swap file by the name ".bash_profile.swp"

7. An error occurs when executing npm install -g stf

8. After reinstalling the dependencies that have not been successfully installed, stf is still not installed successfully

9. Execute stf doctor, prompt command not found

10. Execute stf doctor, prompt lazy symbol binding failed: Symbol not found: _zmq_version

1. Before installing nvm, you need to ensure that there are no node and npm on the computer. How to completely uninstall node on mac

Reference document: https://blog.csdn.net/huangpb123/article/details/120248002

sudo npm uninstall npm -g

brew uninstall node

If there is a .npm folder on the computer, execute sudo rm -rf ~/.npm

Verify that the uninstall was successful:

node #提示command not found

npm  #提示command not found

2. Execute sudo npm uninstall npm -g, prompt env: node: No such file or directory

It may be because the node is uninstalled first and then this command is executed, it will prompt that there is no node file;

You can try to manually delete the .npm file

sudo rm -rf ~/.npm

3. When installing and configuring nvm, an environment variable is added to the .bash_profile in the root directory, but the execution of the nvm command still fails, prompting: nvm: command not found

If you want to add nvm to the shell, you can use it directly in the terminal;

$ echo "source $(brew --prefix nvm)/nvm.sh" >> .bash_profile 或者把这句加入环境变量
$ . ~/.bash_profile
$ nvm --version #查看nvm版本

4. An error is reported when installing rethinkdb: Error: rethinkdb: no bottle available!

 Solution: Execute the following command, and then install it again;

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
brew update

5. Failed to start rethinkdb, port 8080 is occupied

rethinkdb --port-offset 3 -d data/
-d will have a data folder in the current path to store data. The
default management page http service of rethinkdb service occupies port 8080, but many times our port 8080 will be occupied by other applications, so you can specify this parameter, port number offset;

6. Configure environment variables and report an error when operating .bash_profile: Found a swap file by the name ".bash_profile.swp"

Exit abnormally when operating the bash_profile file, which will cause the system to create a bash_profile.swp file

Solution:

  • Type q (quit)

  • Then enter and exit in the terminal: rm -f ~/.bash_profile.swp

  • Finally, you can enter source ~/.bash_profile in the terminal

7. An error occurs when executing npm install -g stf

bufferutil depends on the installation error, install this dependency separately;

8. After reinstalling the dependencies that have not been successfully installed, stf is still not installed successfully

You can try to use v8.14.0 node to install stf, and the installation can be successful.

9. Execute stf doctor, prompt command not found

This is because after the terminal is closed and reopened, the default node version becomes 8.17, and stf is installed based on the 8.14 version of node;

nvm use 8.14

After switching to version 8.14 node, execute stf doctor again;

10. Execute stf doctor, prompt lazy symbol binding failed: Symbol not found: _zmq_version

I found a lot of solutions on the Internet, mainly to install zmq separately, but I installed zmq separately, and configured zmq environment variables, stf doctor will still have this prompt;

It is found that computers with many m1 chips have this problem, but computers with intel chips have no problem;

One solution is to install a new stf which is devicefarmer stf;

GitHub - DeviceFarmer/stf: Control and manage Android devices from your browser.

 

Guess you like

Origin blog.csdn.net/Vermouth_00/article/details/128719797
STF