安裝教程可以參考我之前寫的,這裡不再多說,直接說問題。
安裝完成後輸入stf doctor檢視工具依賴是否正确
問題1:Unexpected error checking ZeroMQ: Error: Module version mismatch. Expected 48, got 47.
問題分析:根據錯誤提示,初步定位node moudle的版本不一緻,期望的是48,而我的node moudle 是47.于是進入node官網(
https://nodejs.org/en/download/releases/)下載下傳moudle等于48的nodejs版本。
node moudle version 可以根據下圖中紅框一列來确定自己所需要的版本。
解決方法:将v5.x版本更新到v6.x後,再次運作stf doctor,該問題解決。又出現問題2。
ps:問題靈感源:
https://github.com/nodejs/node/wiki/Breaking-changes-between-v6-and-v7Native Modules (Addons)
- The Native Module version mismatch error has been updated to be far more clear.
- Refs: [
], #83911fda657cac
- Refs: [
Previously:
Module version mismatch. Expected 51, got 48.
Now:
The module '<module>'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 51. Please try re-compiling or Re-installing
the module (for instance, using `npm rebuild` or `npm install`).
- The
is nowNODE_MODULE_VERSION
.51
問題2:Error: The module '/usr/local/lib/node_modules/stf/node_modules/[email protected]@zmq/build/Release/zmq.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 47. This version of Node.js requires NODE_MODULE_VERSION 57. Please try re-compiling or re-installing the module
問題分析:在GitHub上看到外國友人這麼說的:
大概是說在安裝某個依賴應用中,我們更新或者安裝了其他版本的node版本導緻安裝應用時所使用node版本與我們變更後目前的node版本不一緻。
解決方法:根據錯誤提示建議,及國外友人建議,執行npm install 或 npm rebuild去重新建構node,注意:執行npm install / npm rebuild指令必須進入stf根目錄執行
問題3:
scripts.prepublish: "bower install --allow-root && not-in-install && gulp build || in-install"
(node:1305) 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.
module.js:442
throw err;
^
Error: Cannot find module 'strip-json-comments'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/root/stf-master/node_modules/.npminstall/eslint/2.13.0/eslint/lib/config/config-file.js:23:21)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
Error: Run "sh -c bower install --allow-root && not-in-install && gulp build || in-install" error, exit code 1
Error: Run "sh -c bower install --allow-root && not-in-install && gulp build || in-install" error, exit code 1
at ChildProcess.proc.on.code (/usr/lib/node_modules/cnpm/node_modules/runscript/index.js:67:21)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
解決方法:參考
https://toutiao.io/posts/9kf4j3/preview方可解決
問題4:插入手機後,STF顯示手機資訊但一直處于disconnect狀态,重新整理頁面後,手機裝置資訊全部消失。檢視stf控制台輸出,如下:
FTL/util:lifecycle 7678 [5e56e8f2] Shutting down due to fatal error
INF/provider 6994 [*] Cleaning up device worker "5e56e8f2"
ERR/provider 6994 [*] Device worker "5e56e8f2" died with code 1
npm ERR! [email protected] install:
node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
解決方法:
1、install yams, run
brew install yasm
2、At last run
cnpm install -g stf