1. npm install 遇到 node-sass 问题
ERROR in ENOENT: no such file or directory, scandir '/opt/coding/try_stf/node_modules/node-sass/vendor'
解决方法
cahesi@ubuntu:~$ ls /opt/coding/try_stf/node_modules/node-sass/vendor
ls: cannot access 'vendor': No such file or directory
cahesi@ubuntu:~$ sudo npm rebuild node-sass
2. stf doctor 自检时 zmq 问题
cahesi@ubuntu:/opt/coding/try_stf$ sudo stf doctor
INF/cli:doctor 4682 [*] OS Arch: x64
INF/cli:doctor 4682 [*] OS Platform: linux
INF/cli:doctor 4682 [*] OS Platform: 4.4.0-83-generic
INF/cli:doctor 4682 [*] Using Node 6.9.5
ERR/cli:doctor 4682 [*] Unexpected error checking ZeroMQ: Error: Could not locate the bindings file. Tried:
→ /opt/coding/try_stf/node_modules/zmq/build/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/build/Debug/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/build/Release/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/out/Debug/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/Debug/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/out/Release/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/Release/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/build/default/zmq.node
→ /opt/coding/try_stf/node_modules/zmq/compiled/6.9.5/linux/x64/zmq.node
INF/cli:doctor 4682 [*] Using RethinkDB 2.3.6~0xenial
INF/cli:doctor 4682 [*] Using GraphicsMagick 1.3.23
INF/cli:doctor 4682 [*] Using ADB 1.0.32
ERR/cli:doctor 4682 [*] ProtoBuf is not installed (`protoc` is missing)
这个问题,需要注意 node 的版本,之前出现过一次升级 node 后报 zmq 的问题,初步断定是 zmq 在 node 升级版本之后,并没有进行 rebuild 导致。
如今我是直接用干净的环境进行,直接 install 一次看看
cahesi@ubuntu:/opt/coding/try_stf$ sudo npm install zmq
(node:4699) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
> zmq@2.15.3 install /opt/coding/try_stf/node_modules/zmq
> node-gyp rebuild
make: Entering directory '/opt/coding/try_stf/node_modules/zmq/build'
CXX(target) Release/obj.target/zmq/binding.o
SOLINK_MODULE(target) Release/obj.target/zmq.node
COPY Release/zmq.node
make: Leaving directory '/opt/coding/try_stf/node_modules/zmq/build'
stf@2.3.0 /opt/coding/try_stf
└── zmq@2.15.3
再次自检
cahesi@ubuntu:/opt/coding/try_stf$ sudo stf doctor
INF/cli:doctor 4778 [*] OS Arch: x64
INF/cli:doctor 4778 [*] OS Platform: linux
INF/cli:doctor 4778 [*] OS Platform: 4.4.0-83-generic
INF/cli:doctor 4778 [*] Using Node 6.9.5
INF/cli:doctor 4778 [*] Using ZeroMQ 4.1.2
INF/cli:doctor 4778 [*] Using RethinkDB 2.3.6~0xenial
INF/cli:doctor 4778 [*] Using GraphicsMagick 1.3.23
INF/cli:doctor 4778 [*] Using ADB 1.0.32
ERR/cli:doctor 4778 [*] ProtoBuf is not installed (`protoc` is missing)
OK
3. 启动之后,插上手机遇到如下问题
FTL/device 3099 [801ee4f2] Setup had an error Error: Cannot find module '/usr/local/lib/node_modules/stf/node_modules/jpeg-turbo/lib/binding/node-v46-linux-x64/jpegturbo.node'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
解决方法
cahesi@ubuntu:~$ sudo npm install jpeg-turbo -g