【问题标题】:Can not install wdio-jasmine-framework无法安装 wdio-jasmine-framework
【发布时间】:2020-02-27 17:25:18
【问题描述】:

我想使用命令“npm i wdio-jasmine-framework --save-dev”安装包“wdio-jasmine-framework”,但我收到此错误消息。我已经尝试删除全局“node-gyp”包。我用https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md 检查了我的mac os 是否准备好使用它,并且在这里https://github.com/nodejs/node-gyp 也试过了。还是不行。节点版本 13.0.1,npm 版本 6.12.0。

我刚刚尝试过这个教程https://medium.com/the-web-tub/testing-cordova-apps-with-appium-2b3b236e026b

ps:我是前端新手

packag.json

  "name": "APPNAME-mobile-integration-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "wdio tests/wdio.conf.js",
    "appium": "appium",
    "appium-doctor": "appium-doctor"
  },
  "keywords": [],
  "author": "XXX XXX",
  "license": "ISC",
  "devDependencies": {
    "appium": "^1.15.1",
    "appium-doctor": "^1.12.1",
    "core-js": "^3.3.6",
    "wdio-appium-service": "^0.2.3",
    "wdio-jasmine-framework": "^0.3.8",
    "wdio-spec-reporter": "^0.1.5",
    "webdriverio": "^5.15.6"
  }
}

错误信息

> node build.js || nodejs build.js

  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:68:2: error: no template named 'Handle'
        Handle<String> NewLatin1String(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:69:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:72:2: error: no template named 'Handle'
        Handle<String> NewLatin1Symbol(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:73:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:94:2: error: no template named 'Handle'
        Handle<Object> NewInstance(Isolate* isolate, Local<Function> fn, int argc, Local<Value> argv[]) {
        ^
../src/fibers.cc:95:10: error: no viable conversion from returned value of type 'Local<v8::Object>' to function return type 'int'
                return fn->NewInstance(isolate->GetCurrentContext(), argc, argv).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:104:2: error: no template named 'Handle'
        Handle<Number> ToNumber(Local<Value> value) {
        ^
../src/fibers.cc:105:10: error: no viable conversion from returned value of type 'Local<v8::Number>' to function return type 'int'
                return value->ToNumber(Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:114:50: error: no template named 'Handle'
        Local<Value> GetStackTrace(TryCatch* try_catch, Handle<Context> context) {
                                                        ^
../src/fibers.cc:127:39: error: no template named 'Handle'
        void fixStackLimit(Isolate* isolate, Handle<Context> context) {
                                             ^
../src/fibers.cc:149:58: error: no template named 'Handle'
        void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
                                                                ^
../src/fibers.cc:162:7: error: variable has incomplete type 'void'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
             ^
../src/fibers.cc:162:26: error: use of undeclared identifier 'Handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                ^
../src/fibers.cc:162:33: error: 'T' does not refer to a value
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                       ^
../src/fibers.cc:161:18: note: declared here
        template <class T>
                        ^
../src/fibers.cc:162:36: error: use of undeclared identifier 'handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                          ^
../src/fibers.cc:162:48: error: expected '(' for function-style cast or type construction
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                  ~~~ ^
../src/fibers.cc:162:59: error: expected '(' for function-style cast or type construction
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                             ~~~~^
../src/fibers.cc:162:61: error: use of undeclared identifier 'val'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                                   ^
../src/fibers.cc:162:65: error: expected ';' at end of declaration
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                                                       ^
                                                                       ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/XXX/.nvm/versions/node/v13.0.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/Users/XXX/.nvm/versions/node/v13.0.1/bin/node" "/Users/XXX/.nvm/versions/node/v13.0.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/XXX/Documents/APPNAME/APP-mobile-integration-test/node_modules/wdio-sync/node_modules/fibers
gyp ERR! node -v v13.0.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN APP-mobile-integration-test@1.0.0 No description
npm WARN APP-mobile-integration-test@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@3.1.1 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@3.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/XXX/.npm/_logs/2019-11-01T11_40_02_099Z-debug.log```

【问题讨论】:

    标签: node.js cordova testing npm appium


    【解决方案1】:

    尝试删除您的 package-lock.json 并重新运行 npm install

    【讨论】:

    • 你能不能也分享一下你的package.json
    【解决方案2】:

    解决方案

    我不明白这个奇怪的版本,但我现在使用:

    "wdio-jasmine-framework": "^5.0.0-beta.3"

    【讨论】:

      猜你喜欢
      • 2012-05-26
      • 2018-12-28
      • 1970-01-01
      • 2017-03-19
      • 1970-01-01
      • 1970-01-01
      • 2018-07-10
      • 2023-03-08
      • 1970-01-01
      相关资源
      最近更新 更多