Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

Time:2021-9-16

1. Install the electron

The first step went wrong and couldn’t be installed
The specific embodiment is that NPM install does not report an error, but when running, it prompts that there is a lack of electron and asks whether it is installed
Or an error is reported during direct installation

In essence, when installing the electron package, the network is limited and not installed

Solution 1: use NRM to manage the NPM source, and then NRM use Taobao to switch to Taobao source or NRM use npmmirror
Solution 2: manual node. / node_ Modules / electron / install.js is usually stuck here
If there are the following phenomena, the installation is basically successful
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

2.electron-forge

The official example uses this packaging tool, but note that it can only print the package of this system. For example, if my Mac computer wants to print the windows package, it can’t

3.electron-packager

Installing this plug-in can print windows packages

//Package.json package command
"scripts": {
    "package-win":"electron-packager ./ --platform=win32 --out ./dist  --overwrite  --ignore=node_modules --arch=x64"
  }

However, when packaging, it will be said that the MAC lacks a win environment and needs to be installed with brew, and a command is givenbrew install --cask wine-stable
After looking at the official documents, it is true
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

4.homebrew

There is something wrong with my homebrew. The brew update is stuck and can’t connect to the homebrew address of GitHub
After tossing around for a day, I tried the online method. Finally, it is summarized as follows(My situation may not apply to you, but can only be used as a reference)

  • 1. Turn off the local VPN and the proxy
git config --global --unset http.proxy 
git config --global --unset https.proxy
  • 2 brew config observe that all sources use GitHub instead of image
  • 3 GitHub IP added tovim /etc/hostsPing GitHub can get IP
    Mac computer electronic packaging windows software stepping on the pit trip (homebrew)
    Mac computer electronic packaging windows software stepping on the pit trip (homebrew)
  • 4 connect 5g mobile hotspot(Don't ask me why. After a day of tossing and turning, it's solved in this way. In terms of network speed, the download speed of 5 ~ 10m is also really fragrant
    The update is successful. Check the version. It is indeed the latest version (yes, from GitHub, the latest version of branch was issued in 19 years)
    Mac computer electronic packaging windows software stepping on the pit trip (homebrew)
    There is no problem installing win again. All kinds of automatic installation are successful
    Mac computer electronic packaging windows software stepping on the pit trip (homebrew)
    Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

5. Package windows software, and the permissions are not correct

sudo npm run package-win  

Some dependencies will be automatically installed in the future. You need to click the installation manually. It has a strong windows style
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

Then a permission problem was encountered
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)
The owner of this file is $user (FYy), not root. We can’t execute it with root. Change its ownership and then execute OK
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

sudo chown -R root .wine/

Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

6. Happy packing

Then execute the packaging command to package happily
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)
success:
Mac computer electronic packaging windows software stepping on the pit trip (homebrew)

Recommended Today

Seven Python code review tools recommended

althoughPythonLanguage is one of the most flexible development languages at present, but developers often abuse its flexibility and even violate relevant standards. So PythoncodeThe following common quality problems often occur: Some unused modules have been imported Function is missing arguments in various calls The appropriate format indentation is missing Missing appropriate spaces before and after […]