安装 fiber@2.0.2 时出错

Posted

技术标签:

【中文标题】安装 fiber@2.0.2 时出错【英文标题】:Getting error while installing fibers@2.0.2 【发布时间】:2020-09-27 01:29:51 【问题描述】:

我正在处理一个旧节点项目,在执行 npm install 时出现错误

节点版本:v13.8.0 npm 版本:6.14.4 Mac 操作系统版本:10.15.5

起初,我遇到了 X-Code 问题,我在重新安装 X-Code 后已修复。

问题似乎在 npm 页面上,但没有人回复它

https://npm.community/t/npm-install-failing-gyp-err-stack-error-make-failed-with-exit-code-2-and-npm-err-failed-at-the-fibers-1-0-15-install-script/8195/2

> fibers@2.0.2 install /Users/cksharma/projects/step-library/some-library/node_modules/fibers
> 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:126:58: error: no template named 'Handle'
        void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) 
                                                                ^
../src/fibers.cc:139:7: error: variable has incomplete type 'void'
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
             ^
../src/fibers.cc:139:26: error: use of undeclared identifier 'Handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                ^
../src/fibers.cc:139:33: error: 'T' does not refer to a value
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                       ^
../src/fibers.cc:138:18: note: declared here
        template <class T>
                        ^
../src/fibers.cc:139:36: error: use of undeclared identifier 'handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                          ^
../src/fibers.cc:139:48: error: expected '(' for function-style cast or type construction
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                                  ~~~ ^
../src/fibers.cc:139:59: error: expected '(' for function-style cast or type construction
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                                             ~~~~^
../src/fibers.cc:139:61: error: use of undeclared identifier 'val'
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                                                   ^
../src/fibers.cc:139:65: error: expected ';' at end of declaration
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                                                       ^
                                                                       ;
../src/fibers.cc:139:66: error: expected unqualified-id
        void SetInternalPointer(Handle<T> handle, int index, void* val) 
                                                                        ^
../src/fibers.cc:143:27: error: use of undeclared identifier 'Handle'
        void* GetInternalPointer(Handle<T> handle, int index) 
                                 ^
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/Cellar/node/13.8.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/cksharma/projects/step-library/step-library/node_modules/fibers
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.1.0
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`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@2.0.2 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我已经尝试检查 node-fiber github 页面,但没有发现任何有用的东西。

【问题讨论】:

这有什么好运气吗?我有完全相同的问题 @CodeTower 不走运 :( 我没有太多时间来研究它。 【参考方案1】:

我遇到了这个问题,因为“typescript”是一个正常的依赖而不是 devDependency,当我将“typescript”作为 devDependency 移动时它起作用了。

【讨论】:

以上是关于安装 fiber@2.0.2 时出错的主要内容,如果未能解决你的问题,请参考以下文章

VS2010 安装Opencv2.3时出错

MySQL 5.7.4 安装结束时出错,提示我密码过期

安装DX文件时出错

请问R语言在安装pc包时出错是怎么回事

使用PUTTY+xming时出错

安装SQL SERVER 2008 R2后,运行时出错。