代码之家  ›  专栏  ›  技术社区  ›  pankaj

无法在React Native项目上执行NPM安装

  •  0
  • pankaj  · 技术社区  · 5 年前

    我正在一个react本地项目中工作,并希望安装react导航库,为此我正在尝试先安装npm,但我不能这样做。
    节点版本:v12.4.0
    NPM版本:6.9.0

    我得到以下错误:

    node-pre-gyp WARN Using request for node-pre-gyp https download
    node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@12.4.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib'
    gyp ERR! configure error
    gyp ERR! stack Error: Command failed: /anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
    gyp ERR! stack   File "<string>", line 1
    gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
    gyp ERR! stack                                ^
    gyp ERR! stack SyntaxError: invalid syntax
    gyp ERR! stack
    gyp ERR! stack     at ChildProcess.exithandler (child_process.js:290:12)
    gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
    gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
    gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:430:11)
    gyp ERR! stack     at Socket.emit (events.js:200:13)
    gyp ERR! stack     at Pipe.<anonymous> (net.js:586:12)
    gyp ERR! System Darwin 17.7.0
    gyp ERR! command "/Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/bin/node" "/Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
    gyp ERR! cwd /Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents
    gyp ERR! node -v v12.4.0
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute '/Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/bin/node /Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
    node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
    node-pre-gyp ERR! System Darwin 17.7.0
    node-pre-gyp ERR! command "/Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/bin/node" "/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd /Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents
    node-pre-gyp ERR! node -v v12.4.0
    node-pre-gyp ERR! node-pre-gyp -v v0.12.0
    node-pre-gyp ERR! not ok
    Failed to execute '/Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/bin/node /Users/pankaj.sachdeva/.nvm/versions/node/v12.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/pankaj.sachdeva/Desktop/HD/ReactNative/instaClone/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
    npm WARN @react-navigation/native@3.5.0 requires a peer of react-native-gesture-handler@* but none is installed. You must install peer dependenciesyourself.
    npm WARN react-navigation-drawer@1.2.1 requires a peer of react-native-gesture-handler@^1.0.12 but none is installed. You must install peer dependencies yourself.
    npm WARN react-navigation-stack@1.4.0 requires a peer of react-native-gesture-handler@^1.0.0 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
    
    0 回复  |  直到 5 年前