首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装fibers@2.0.2时出错

安装fibers@2.0.2时出错
EN

Stack Overflow用户
提问于 2020-06-08 14:11:08
回答 1查看 2.3K关注 0票数 10

我正在处理一个旧的节点项目,在执行npm安装时遇到错误

节点版本: v13.8.0 Npm版本: 6.14.4 Mac OS版本: 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

代码语言:javascript
复制
> 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.

我试过检查节点光纤github页面,但没有找到任何有用的东西。

EN

回答 1

Stack Overflow用户

发布于 2020-12-02 23:07:02

我有这个问题是因为"typescript“是一个普通的依赖,而不是一个devDependency,当我将"typescript”作为devDependency移动时,它是有效的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62256036

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档