micro:bit - pxt 설치(오프라인 블럭 컴파일러 구축)

OS/micro:bit 2018.04.07 22:45 Posted by 파란크리스마스

출처

pxt 관련 라이브러리 설치

D:\microbit>npm install -g jake
C:\Users\bluesanta\AppData\Roaming\npm\jake -> C:\Users\bluesanta\AppData\Roaming\npm\node_modules\jake\bin\cli.js
+ jake@8.0.16
added 13 packages in 2.485s

D:\microbit>npm install -g typings
npm WARN deprecated typings@2.1.1: Typings is deprecated in favor of NPM @types -- see README for more information
C:\Users\bluesanta\AppData\Roaming\npm\typings -> C:\Users\bluesanta\AppData\Roaming\npm\node_modules\typings\dist\bin.js
+ typings@2.1.1
added 183 packages in 12.988s

pxt 다운로드

D:\microbit>git clone https://github.com/microsoft/pxt
Cloning into 'pxt'...
remote: Counting objects: 52887, done.
remote: Compressing objects: 100% (424/424), done.
remote: Total 52887 (delta 311), reused 324 (delta 173), pack-reused 52279
Receiving objects: 100% (52887/52887), 131.47 MiB | 197.00 KiB/s, done.
Resolving deltas: 100% (37029/37029), done.

D:\microbit>cd pxt

D:\microbit\pxt>git checkout v0
Switched to a new branch 'v0'
Branch 'v0' set up to track remote branch 'v0' from 'origin'.

pxt 설치

D:\microbit\pxt>npm install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) added 115 packages in 12.661s D:\microbit\pxt>typings install D:\microbit\pxt>jake D:\microbit\pxt>cd ../ D:\microbit>

pxt-microbit 설치

D:\microbit>git clone https://github.com/microsoft/pxt-microbit
D:\microbit>cd pxt-microbit
D:\microbit\pxt-microbit>npm install -g pxt
D:\microbit\pxt-microbit>npm install
D:\microbit\pxt-microbit>npm link ../pxt
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 115 packages in 21.441s
C:\server\node-v8.9.1-win-x64\node_modules\pxt-core -> D:\microbit\pxt
D:\microbit\pxt-microbit\node_modules\pxt-core -> C:\server\node-v8.9.1-win-x64\node_modules\pxt-core -> D:\microbit\pxt

pxt 서버 실행

(workspace) D:\>mkdir pxtsrc

(workspace) D:\>cd pxtsrc

(workspace) D:\pxtsrc>pxt target microbit
Installing pxt-microbit locally; don't worry about package.json warnings.

> keytar@4.2.1 install D:\pxtsrc\node_modules\keytar
> prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.5.1
prebuild-install info looking for local prebuild @ prebuilds\keytar-v4.2.1-node-v57-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\bluesanta\AppData\Roaming\npm-cache\_prebuilds\https-github.com-atom-node-keytar-releases-download-v4.2.1-keytar-v4.2.1-node-v57-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\bluesanta\AppData\Roaming\npm-cache\_prebuilds\https-github.com-atom-node-keytar-releases-download-v4.2.1-keytar-v4.2.1-node-v57-win32-x64.tar.gz
prebuild-install info unpack resolved to D:\pxtsrc\node_modules\keytar\build\Release\keytar.node
prebuild-install info unpack required D:\pxtsrc\node_modules\keytar\build\Release\keytar.node successfully
prebuild-install info install Successfully installed prebuilt binary!

> node-hid@0.5.7 install D:\pxtsrc\node_modules\node-hid
> prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.5.1
prebuild-install info looking for local prebuild @ prebuilds\node-hid-v0.5.7-node-v57-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\bluesanta\AppData\Roaming\npm-cache\_prebuilds\https-github.com-node-hid-node-hid-releases-download-v0.5.7-node-hid-v0.5.7-node-v57-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\bluesanta\AppData\Roaming\npm-cache\_prebuilds\https-github.com-node-hid-node-hid-releases-download-v0.5.7-node-hid-v0.5.7-node-v57-win32-x64.tar.gz
prebuild-install info unpack resolved to D:\pxtsrc\node_modules\node-hid\build\Release\HID.node
prebuild-install info unpack required D:\pxtsrc\node_modules\node-hid\build\Release\HID.node successfully
prebuild-install info install Successfully installed prebuilt binary!

> serialport@6.1.1 install D:\pxtsrc\node_modules\serialport
> prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.5.1
prebuild-install info looking for local prebuild @ prebuilds\serialport-v6.1.1-node-v57-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\bluesanta\AppData\Roaming\npm-cache\_prebuilds\https-github.com-node-serialport-node-serialport-releases-download-v6.1.1-serialport-v6.1.1-node-v57-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\bluesanta\AppData\Roaming\npm-cache\_prebuilds\https-github.com-node-serialport-node-serialport-releases-download-v6.1.1-serialport-v6.1.1-node-v57-win32-x64.tar.gz
prebuild-install info unpack resolved to D:\pxtsrc\node_modules\serialport\build\Release\serialport.node
prebuild-install info unpack required D:\pxtsrc\node_modules\serialport\build\Release\serialport.node successfully
prebuild-install info install Successfully installed prebuilt binary!
npm WARN saveError ENOENT: no such file or directory, open 'D:\pxtsrc\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'D:\pxtsrc\package.json'
npm WARN pxtsrc No description
npm WARN pxtsrc No repository field.
npm WARN pxtsrc No README data
npm WARN pxtsrc No license field.

+ pxt-microbit@0.14.30
added 384 packages in 15.705s
Installed PXT/microbit. To start server run:
    pxt serve

(workspace) D:\pxtsrc>pxt serve
Using target PXT/microbit with build engine yotta
  Target dir:   D:\pxtsrc\node_modules\pxt-microbit
  PXT Core dir: D:\pxtsrc\node_modules\pxt-core
Invalid accessToken format, expecting something like 'https://example.com/?access_token=0abcd.XXXX'
Going to D:\pxtsrc\node_modules\pxt-microbit
No sim/tsconfig.json; assuming npm installed package
Starting server in D:\pxtsrc\node_modules\pxt-microbit
With pxt core at D:\pxtsrc\node_modules\pxt-core
starting local ws server at 3233...
serial: monitoring ports...
---------------------------------------------

To launch the editor, open this URL:
http://localhost:3232/#local_token=452b727d-6d77-4d83-98d5-0bdab305f72e&wsport=3233

---------------------------------------------
opening http://localhost:3232/#local_token=452b727d-6d77-4d83-98d5-0bdab305f72e&wsport=3233

프로젝트 생성

D:\pxtsrc\projects>mkdir pxt-ultrasonic-microbit

D:\pxtsrc\projects>cd pxt-ultrasonic-microbit

D:\pxtsrc\projects\pxt-ultrasonic-microbit>pxt init
Using target PXT/microbit with build engine yotta
  Target dir:   D:\pxtsrc\node_modules\pxt-microbit
  PXT Core dir: D:\pxtsrc\node_modules\pxt-core
Invalid accessToken format, expecting something like 'https://example.com/?access_token=0abcd.XXXX'
name [ultrasonic-microbit]:
description []:
license [MIT]:
skipping download of local pkg: file:.
Package initialized.
Try 'pxt add' to add optional features.

D:\pxtsrc\projects\pxt-ultrasonic-microbit>code .

빌드



 

티스토리 툴바