#node.js #reactjs #npm #react-apollo
Вопрос:
Я пытаюсь установить react-apollo в свой проект react. Во время установки он застрял в node-gyp, и через некоторое время он выдает длительную ошибку, и в конечном итоге установка каждый раз завершается неудачно.
Я попробовал несколько решений.
Попытался установить windows-dev-tools с помощьюnpm install --global --production windows-build-tools
,который застрял через некоторое время (X)
Попытался установитьnpm i node-pre-gyp
, что вызывало эти ошибки.
Мое package.json
досье
{
"name": "",
"version": "0.1.0",
"proxy": "http://localhost:5000",
"private": true,
"dependencies": {
"firebase": "6.0.2",
"node-sass": "4.12.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "7.0.3",
"react-router-dom": "5.0.0",
"react-stripe-checkout": "2.6.3",
"redux": "4.0.1",
"redux-logger": "3.0.6",
"redux-persist": "5.10.0",
"reselect": "4.0.0"
},
"devDependencies": {
"react-scripts": "3.0.0"
},
"resolutions": {
"babel-jest": "24.7.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Я попытался изменить версию react на
"react": "^17.0.2",
И реагируют-скрипты на"react-scripts": "4.0.3",
, НОreact-apollo
тоже не устанавливались.
А вот и ошибки
npm WARN deprecated grpc@1.20.3: This library will not receive further updates other than security fixes. We recommend using @grpc/grpc-js instead.
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated eslint-loader@2.1.2: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14 . Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring@0.2.0: The
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated html-webpack-plugin@4.0.0-beta.5: please switch to a stable version
npm WARN deprecated babel-eslint@10.0.1: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@3.0.1: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpc
npm ERR! command failed
npm ERR! command S:WINDOWSsystem32cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Failed to execute 'S:Program Filesnodejsnode.exe S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --library=static_library --module=T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpcsrcnodeextension_binarynode-v83-win32-x64-unknowngrpc_node.node --module_name=grpc_node --module_path=T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpcsrcnodeextension_binarynode-v83-win32-x64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83 --msvs_version=2015' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.13.0
npm ERR! node-pre-gyp info using node@14.17.1 | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpcsrcnodeextension_binarynode-v83-win32-x64-unknowngrpc_node.node" (not found)npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.20.3/node-v83-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.20.3/node-v83-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.20.3/node-v83-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for grpc@1.20.3 and node@14.17.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.20.3/node-v83-win32-x64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.17.1 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.17.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.7.6 found at "S:Userssifatanaconda3python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2015
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.9.31205.134) found at:
npm ERR! gyp ERR! find VS "S:Program Files (x86)Microsoft Visual Studio2019Community"
npm ERR! gyp ERR! find VS - found "Visual Studio C core features"
npm ERR! gyp ERR! find VS - found VC toolset: v142
npm ERR! gyp ERR! find VS - found Windows SDK: 10.0.16299.0
npm ERR! gyp ERR! find VS - msvs_version does not match this version
npm ERR! gyp ERR! find VS checking VS2017 (15.9.28307.1525) found at:
npm ERR! gyp ERR! find VS "S:Program Files (x86)Microsoft Visual Studio2017BuildTools"
npm ERR! gyp ERR! find VS - found "Visual Studio C core features"
npm ERR! gyp ERR! find VS - found VC toolset: v141
npm ERR! gyp ERR! find VS - found Windows SDK: 10.0.17763.0
npm ERR! gyp ERR! find VS - msvs_version does not match this version
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS - "2019"
npm ERR! gyp ERR! find VS - "S:Program Files (x86)Microsoft Visual Studio2019Community"
npm ERR! gyp ERR! find VS - "2017"
npm ERR! gyp ERR! find VS - "S:Program Files (x86)Microsoft Visual Studio2017BuildTools"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C " workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:121:47)
npm ERR! gyp ERR! stack at S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:74:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:351:14)
npm ERR! gyp ERR! stack at S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:70:14
npm ERR! gyp ERR! stack at S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-visualstudio.js:372:16
npm ERR! gyp ERR! stack at S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibutil.js:54:7
npm ERR! gyp ERR! stack at S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibutil.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:326:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:375:28)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "S:\Program Files\nodejs\node.exe" "S:\Users\sifat\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=T:\WorkSpace\Developing\Web-Development\React\Practise\React-Bootcamp-2021\graph-crwn-clothing2\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=T:\WorkSpace\Developing\Web-Development\React\Practise\React-Bootcamp-2021\graph-crwn-clothing2\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83" "--msvs_version=2015"
npm ERR! gyp ERR! cwd T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpc
npm ERR! gyp ERR! node -v v14.17.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'S:Program Filesnodejsnode.exe S:UserssifatAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --library=static_library --module=T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpcsrcnodeextension_binarynode-v83-win32-x64-unknowngrpc_node.node --module_name=grpc_node --module_path=T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpcsrcnodeextension_binarynode-v83-win32-x64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83 --msvs_version=2015' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpcnode_modulesnode-pre-gyplibutilcompile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (events.js:375:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19042
npm ERR! node-pre-gyp ERR! command "S:\Program Files\nodejs\node.exe" "T:\WorkSpace\Developing\Web-Development\React\Practise\React-Bootcamp-2021\graph-crwn-clothing2\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd T:WorkSpaceDevelopingWeb-DevelopmentReactPractiseReact-Bootcamp-2021graph-crwn-clothing2node_modulesgrpc
npm ERR! node-pre-gyp ERR! node -v v14.17.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.13.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! S:UserssifatAppDataLocalnpm-cache_logs2021-07-09T21_29_35_879Z-debug.log
I think, whats causing the problem is node-pre-gyp, can somebody help me, HOW CAN I INSTALL THIS LIBRARY IN WINDOWS?