因爲不能科學的上網。網上看資料裝上了這個插件,裝的過程有點坑。記錄一下,但願能幫到和我同樣的新手。node
1.第一步,克隆下遠程倉庫的東西。python
桌面右鍵,git-bash。而後輸入:react
git clone https://github.com/facebook/react-devtools.git
這個過程耗時比較長。git
結果:github
2.第二步, 進入到react-devtools目錄,安裝依賴chrome
cd react-devtools
npm install
過程耗時長。安裝碰上的狀況。以下:shell
admin@battle MINGW64 ~/Desktop $ cd react-devtools admin@battle MINGW64 ~/Desktop/react-devtools (master) $ npm install npm WARN deprecated clipboard-js@0.3.6: Please migrate to https://github.com/lgarron/clipboard-polyfill npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead npm WARN deprecated firefox-client@0.3.0: Package no longer supported. Contact support@npmjs.com for more info. npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor. npm WARN deprecated js-select@0.6.0: Package no longer supported. Contact support@npmjs.com for more info. npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart() npm WARN deprecated joi@6.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues. npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated topo@1.1.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). > dtrace-provider@0.8.7 install C:\Users\admin\Desktop\react-devtools\node_modules\dtrace-provider > node-gyp rebuild || node suppress-error.js C:\Users\admin\Desktop\react-devtools\node_modules\dtrace-provider>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\admin\Desktop\react-devtools\node_modules\dtrace-provider gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok > command-join@2.0.1 postinstall C:\Users\admin\Desktop\react-devtools\node_modules\command-join > npx -p @seangenabe/tnx tnx || exit 0 npx: 1 安裝成功,用時 3.104 秒 Thanks for installing command-join! If you like this package, be sure to star its repo, and please consider donating: https://seangenabe.netlify.com/donate > core-js@2.6.9 postinstall C:\Users\admin\Desktop\react-devtools\node_modules\core-js > node scripts/postinstall || echo "ignore" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) > core-js-pure@3.1.4 postinstall C:\Users\admin\Desktop\react-devtools\node_modules\core-js-pure > node scripts/postinstall || echo "ignore" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) > spawn-sync@1.0.15 postinstall C:\Users\admin\Desktop\react-devtools\node_modules\spawn-sync > node postinstall npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN ajv-errors@1.0.1 requires a peer of ajv@>=5.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 notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) added 1781 packages from 819 contributors and audited 32379 packages in 131.133s found 76 vulnerabilities (66 low, 7 moderate, 2 high, 1 critical) run `npm audit fix` to fix them, or `npm audit` for details
直接忽略了。。繼續下一步。npm
3.打包一份擴展程序。以下:json
npm run build:extension:chrome
結果:gulp
這個時候就能夠在react-devtools目錄下找到shells--chrome--build--unpacked文件夾。
4.打開chrome,地址欄輸出:chrome://extensions/。 左上角點擊加載已解壓的擴展程序。把unpacked文件夾放進去了。
大功告成,右上角多了個react圖標。