Closed sxcem closed 5 years ago
Snap4Arduino win10 buglist
First, win10 install unbuntu subsystem and install graphical interface https://blog.csdn.net/Aerry_ale/article/details/83050628
Second, clone snap4arduino cmder under bash into the linux system git clone https://github.com/bromagosa/Snap4Arduino.git note to git clone under linux or windows characters carriage return line-inconsistent
Third, the detection package Before trying to build Snap4Arduino, make sure you have node, npm, sed, git, wget, zip and unzip installed in your system. respectively node -v, etc. check whether these packages have been installed
Fourth, npm can not find a solution microsoft/WSL#1512
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - $ sudo apt-get install -y nodejs then i made some changes to my PATH in my ~/.profile vim ~/. Profile point i Edit esc Exit edit ctrl or alt + arrow Move cursor PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH" $ which npm /usr/bin/npm
Fifth, check all packages root@LAPTOP-PI2JTOFN: /mnt/d/cmder/Snap4Arduino# ./prepare --all
View all compilable platforms root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino# ./build --help=platform Usage: ./build --platform=TARGET [--run] [--deploy =URL --username=USERNAME [--dir=PATH]]
Available platforms are: desktop/gnu/32 desktop/gnu/64 desktop/osx/64 desktop/win/32 desktop/win/64 embedded/cli mobile/android web/chromeos web/chromium
Generic names are also accepted, such as: desktop desktop/gnu mobile this all root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino#
Seven, first compile a windows 64bit program to see
root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino# ./build --platform=desktop/win/64 Will build for the following platforms:
desktop/win/64
======= Building for desktop/win/64... Fetching Snap! sources... Fetching Snap4Arduino examples... Fetching Snap4Arduino libraries... Fetching Snap4Arduino Costumes... Fetching Snap4Arduino core... Fetching platform-specific sources... Fetching assets... Fetching version file... Running platform-specifig build script...
======= Setting up Node dependencies... 'environments/desktop/node_modules' -> 'tmp/node_modules' 'environments/desktop/node_modules/bindings' -> 'tmp/node_modules/bindings' 'environments/desktop/node_modules/bindings/package.json' -> 'tmp/node_modules/bindings/package.json' 'environments/desktop/node_modules/bindings/bindings.js' -> 'tmp/node_modules/bindings/bindings.js' 'environments/desktop/node_modules/bindings/README.md' -> 'tmp/node_modules/bindings/README.md' 'environments/desktop/node_modules/object.assign' -> 'tmp/node_modules/object.assign'
Eight, the error can not find npmbuilder error npm WARN saveError ENOENT: no such file or directory, can not find package.json
Package.json needs to be in which directory where to establish https://segmentfault.com/q/1010000012930521 First, initialize the project, all the way back to the car npm init -f then install dependent npm install formidable --save
Then install npm-builder npm install nw-builder --save-dev Note to install under environments/desktop/node_modules/
Another solution is to create the environment/node_modules directory and install it here, but I have not tested it here.
I modify ./build file
environments/desktop/node_modules/nw-builder/bin/nwbuild -v 0.34.5 -p $platform tmp -o releases/desktop
Otherwise, npmbuild can't be found.
Finally, execute root@LAPTOP-PI2JTOFN:/mnt/d/cmder/snap4arduino# ./build --platform=desktop/win/64
At this point, win10 X64 build success
Snap4Arduino win10 buglist
一、 win10 安装unbuntu 子系统 并安装图形界面 https://blog.csdn.net/Aerry_ale/article/details/83050628
二、克隆 snap4arduino cmder 下 bash 进入linux系统 git clone https://github.com/bromagosa/Snap4Arduino.git 注意要在linux 下git clone 不然windows 字符 回车换行 不一致
三、检测包 Before trying to build Snap4Arduino, make sure you have node, npm, sed, git, wget, zip and unzip installed in your system. 分别 node -v 等检查这些包是否已经安装
四、npm 找不到 解决方案 https://github.com/microsoft/WSL/issues/1512
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - $ sudo apt-get install -y nodejs then i made some changes to my PATH in my ~/.profile vim ~/.profile 点i 进行编辑 esc退出编辑 ctrl或alt +箭头移动光标 PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH" $ which npm /usr/bin/npm
五、检查所有包 root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino# ./prepare --all
六、查看所有可编译的平台 root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino# ./build --help=platform Usage: ./build --platform=TARGET [--run] [--deploy=URL --username=USERNAME [--dir=PATH]]
Available platforms are: desktop/gnu/32 desktop/gnu/64 desktop/osx/64 desktop/win/32 desktop/win/64 embedded/cli mobile/android web/chromeos web/chromium
Generic names are also accepted, such as: desktop desktop/gnu mobile this all root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino#
七、先编译一个windows 64bit 的程序看看
root@LAPTOP-PI2JTOFN:/mnt/d/cmder/Snap4Arduino# ./build --platform=desktop/win/64 Will build for the following platforms:
desktop/win/64
======= Building for desktop/win/64...
Fetching Snap! sources... Fetching Snap4Arduino examples... Fetching Snap4Arduino libraries... Fetching Snap4Arduino Costumes... Fetching Snap4Arduino core... Fetching platform-specific sources... Fetching assets... Fetching version file... Running platform-specifig build script...
======= Setting up Node dependencies...
'environments/desktop/node_modules' -> 'tmp/node_modules' 'environments/desktop/node_modules/bindings' -> 'tmp/node_modules/bindings' 'environments/desktop/node_modules/bindings/package.json' -> 'tmp/node_modules/bindings/package.json' 'environments/desktop/node_modules/bindings/bindings.js' -> 'tmp/node_modules/bindings/bindings.js' 'environments/desktop/node_modules/bindings/README.md' -> 'tmp/node_modules/bindings/README.md' 'environments/desktop/node_modules/object.assign' -> 'tmp/node_modules/object.assign'
八、出错 找不到npmbuilder 出错 npm WARN saveError ENOENT: no such file or directory, 找不到package.json
package.json 需要在哪个目录 就在哪里 建立 https://segmentfault.com/q/1010000012930521 首先,初始化项目,一路回车就行 npm init -f 接着安装依赖 npm install formidable --save
然后安装 npm-builder npm install nw-builder --save-dev 注意安装到 environments/desktop/node_modules/ 下
另一个方案是建立environments/node_modules目录 再安装到这里,但是这里我没有测试
我修改build
environments/node_modules/nw-builder/bin/nwbuild -v 0.34.5 -p $platform tmp -o releases/desktop
environments/desktop/node_modules/nw-builder/bin/nwbuild -v 0.34.5 -p $platform tmp -o releases/desktop
否则出现找不到npmbuild 情况。
最后执行 root@LAPTOP-PI2JTOFN:/mnt/d/cmder/snap4arduino# ./build --platform=desktop/win/64
至此,win10 X64 build success