Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在react native中使用npm安装安装节点模块时出错_Node.js_React Native_Npm Install - Fatal编程技术网

Node.js 在react native中使用npm安装安装节点模块时出错

Node.js 在react native中使用npm安装安装节点模块时出错,node.js,react-native,npm-install,Node.js,React Native,Npm Install,使用npm install安装节点模块时出错 我已经安装了xcode和命令行工具,但构建仍然失败 我正在将一个节点模块添加到我的一个项目中,在我执行npm安装之前,我无法构建该项目。请删除节点模块文件夹并再次执行npm安装。仅仅删除节点模块并进行npm安装并不能修复它 以下是错误输出: clang: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX' [-Wincompatible-sysroot] In fil

使用
npm install安装节点模块时出错
我已经安装了xcode和命令行工具,但构建仍然失败

我正在将一个节点模块添加到我的一个项目中,在我执行npm安装之前,我无法构建该项目。请删除节点模块文件夹并再次执行npm安装。仅仅删除节点模块并进行npm安装并不能修复它

以下是错误输出:

clang: warning: using sysroot for 'iPhoneSimulator' but targeting 'MacOSX' [-Wincompatible-sysroot]
In file included from ../fsevents.cc:72:
../src/thread.cc:36:25: error: unknown type name 'ConstFSEventStreamRef'
void HandleStreamEvents(ConstFSEventStreamRef stream, void *ctx, size_t ...
                        ^
../src/thread.cc:36:108: error: unknown type name 'FSEventStreamEventFlags'
  ...stream, void *ctx, size_t numEvents, void *eventPaths, const FSEventStre...
                                                                  ^
../src/thread.cc:36:152: error: unknown type name 'FSEventStreamEventId'
  ...*eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventSt...
                                                                    ^
../src/thread.cc:54:3: error: unknown type name 'FSEventStreamContext'
  FSEventStreamContext context = { 0, ctx, NULL, NULL, NULL };
  ^
../src/thread.cc:56:3: error: unknown type name 'FSEventStreamRef'
  FSEventStreamRef stream = FSEventStreamCreate(NULL, &HandleStreamEvent...
  ^
../src/thread.cc:56:98: error: use of undeclared identifier
      'kFSEventStreamEventIdSinceNow'
  ...&HandleStreamEvents, &context, fse->paths, kFSEventStreamEventIdSinceNow...
                                                ^
6 errors generated.
make: *** [Release/obj.target/fse/fsevents.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:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/macos/Desktop/baps_yuva/node_modules/fsevents
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 

尝试卸载/重新安装npm:

  • sudo npm卸载npm-g

  • brew安装npm

试试这个

brew update

brew install watchman

npm install -g npm@latest

我也有同样的问题,对我来说,我通过降级npm版本解决了这个问题


npm安装-gnpm@5.6.0

您是如何修复的?