Mac安裝STF-踩坑記錄

一、 STF安裝

1、STF官網:
https://github.com/openstf/stf
2、安裝依賴:
brew install rethinkdb graphicsmagick zeromq protobuf yasm pkg-config
3、安裝STF:
npm install -g stf

二、環境依賴

1、npm及node版本(node.js最好爲8.X系列)

$ npm version
{ wangjuan: '1.0.0',
  npm: '5.5.1',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.1',
  openssl: '1.0.2m',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.47',
  zlib: '1.2.11' }

2、 RethinkDB >= 2.2
3、不支持windows

三、常見問題

1、提示bufferutil包錯誤,報錯信息如下:

16959 verbose stack Error: [email protected] install: `node-gyp rebuild`
16959 verbose stack Exit status 1
16959 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
16959 verbose stack     at EventEmitter.emit (events.js:182:13)
16959 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
16959 verbose stack     at ChildProcess.emit (events.js:182:13)
16959 verbose stack     at maybeClose (internal/child_process.js:962:16)
16959 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
16960 verbose pkgid [email protected]
16961 verbose cwd /Users/wangjuan
16962 verbose Darwin 18.2.0
16963 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "stf" "-g" "--unsafe-perm"
16964 verbose node v10.13.0
16965 verbose npm  v6.4.1
16966 error code ELIFECYCLE
16967 error errno 1
16968 error [email protected] install: `node-gyp rebuild`
16968 error Exit status 1
16969 error Failed at the [email protected] install script.

解決方案:降低node.js版本,最好爲8.X系列 !~

2、提示/usr/local/lib/node_modules 目錄沒有寫權限,報錯信息如下:

553 error Error: EACCES: permission denied, access '/usr/local/lib/node_modules/stf/node_modules/@slack/client/node_modules/async'
2553 error  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/stf/node_modules/@slack/client/node_modules/async'
2553 error   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/stf/node_modules/@slack/client/node_modules/async\'',
2553 error   errno: -13,
2553 error   code: 'EACCES',
2553 error   syscall: 'access',
2553 error   path: '/usr/local/lib/node_modules/stf/node_modules/@slack/client/node_modules/async' }
2554 error The operation was rejected by your operating system.
2554 error It is likely you do not have the permissions to access this file as the current user
2554 error
2554 error If you believe this might be a permissions issue, please double-check the
2554 error permissions of the file and its containing directories, or try running
2554 error the command again as root/Administrator (though this is not recommended).
2555 verbose exit [ -13, true ]

解決方案:
1、刪除原有stf文件夾,重新安裝,千萬別用sudo來執行安裝。
rm -rf /usr/local/lib/node_modules/stf/
2、給/usr/local/lib/node_modules/stf/賦予權限,更改用戶及所屬組
chown 當前用戶:當前用戶的默認組 -R 目錄


以上,對你有幫助的話,點贊❤️吧~~
歡迎關注我的簡書,博客,TesterHome,Github~~~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章