npm 安装 react-devtools
<p>由于不能科学的上网。网上看资料装上了这个插件,装的过程有点坑。记录一下,希望能帮到和我一样的新手。</p><p>1.第一步,克隆下远程仓库的东西。</p>
<p>桌面右键,git-bash。然后输入:</p>
<div class="cnblogs_code">
<pre>git clone https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/facebook/react-devtools.git</span></pre>
</div>
<p>这个过程耗时比较长。</p>
<p>结果:</p>
<p><img src="https://img2018.cnblogs.com/blog/1716959/201908/1716959-20190803172424174-418877864.png"></p>
<p> </p>
<p>2.第二步, 进入到react-devtools目录,安装依赖</p>
<div class="cnblogs_code">
<pre>cd react-<span style="color: rgba(0, 0, 0, 1)">devtools
npm install</span></pre>
</div>
<p>过程耗时长。安装碰上的情况。如下:</p>
<div class="cnblogs_code">
<pre>admin@battle MINGW64 ~/<span style="color: rgba(0, 0, 0, 1)">Desktop
$ cd react</span>-<span style="color: rgba(0, 0, 0, 1)">devtools
admin@battle MINGW64 </span>~/Desktop/react-<span style="color: rgba(0, 0, 0, 1)">devtools (master)
$ npm install
npm WARN deprecated clipboard</span>-js@<span style="color: rgba(128, 0, 128, 1)">0.3</span>.<span style="color: rgba(128, 0, 128, 1)">6</span>: Please migrate to https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/lgarron/clipboard-polyfill</span>
npm WARN deprecated core-js@<span style="color: rgba(128, 0, 128, 1)">1.2</span>.<span style="color: rgba(128, 0, 128, 1)">7</span>: core-js@<<span style="color: rgba(128, 0, 128, 1)">2.6</span>.<span style="color: rgba(128, 0, 128, 1)">8</span> <span style="color: rgba(0, 0, 255, 1)">is</span> no longer maintained. Please, upgrade to core-js@<span style="color: rgba(128, 0, 128, 1)">3</span> or at least to actual version of core-js@<span style="color: rgba(128, 0, 128, 1)">2</span><span style="color: rgba(0, 0, 0, 1)">.
npm WARN deprecated gulp</span>-util@<span style="color: rgba(128, 0, 128, 1)">3.0</span>.<span style="color: rgba(128, 0, 128, 1)">8</span>: gulp-util <span style="color: rgba(0, 0, 255, 1)">is</span> deprecated - replace it, following the guidelines at https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">medium.com/gulpjs/gulp-util-ca3b1f9f9ac5</span>
npm WARN deprecated cross-spawn-async@<span style="color: rgba(128, 0, 128, 1)">2.2</span>.<span style="color: rgba(128, 0, 128, 1)">5</span>: cross-<span style="color: rgba(0, 0, 0, 1)">spawn no longer requires a build toolchain, use it instead
npm WARN deprecated firefox</span>-client@<span style="color: rgba(128, 0, 128, 1)">0.3</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>: Package no longer supported. Contact support@npmjs.com <span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> more info.
npm WARN deprecated circular</span>-json@<span style="color: rgba(128, 0, 128, 1)">0.3</span>.<span style="color: rgba(128, 0, 128, 1)">3</span>: CircularJSON <span style="color: rgba(0, 0, 255, 1)">is</span> <span style="color: rgba(0, 0, 255, 1)">in</span> maintenance only, flatted <span style="color: rgba(0, 0, 255, 1)">is</span><span style="color: rgba(0, 0, 0, 1)"> its successor.
npm WARN deprecated js</span>-<span style="color: rgba(0, 0, 255, 1)">select</span>@<span style="color: rgba(128, 0, 128, 1)">0.6</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>: Package no longer supported. Contact support@npmjs.com <span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> more info.
npm WARN deprecated hawk@</span><span style="color: rgba(128, 0, 128, 1)">3.1</span>.<span style="color: rgba(128, 0, 128, 1)">3</span>: This module moved to @hapi/hawk. Please make sure to <span style="color: rgba(0, 0, 255, 1)">switch</span> over <span style="color: rgba(0, 0, 255, 1)">as</span> <span style="color: rgba(0, 0, 255, 1)">this</span> distribution <span style="color: rgba(0, 0, 255, 1)">is</span><span style="color: rgba(0, 0, 0, 1)"> no longer supported and may contain bugs and critical security issues.
npm WARN deprecated left</span>-pad@<span style="color: rgba(128, 0, 128, 1)">1.3</span>.<span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">: use String.prototype.padStart()
npm WARN deprecated joi@</span><span style="color: rgba(128, 0, 128, 1)">6.10</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>: This version has been deprecated <span style="color: rgba(0, 0, 255, 1)">in</span> accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to <span style="color: rgba(0, 0, 255, 1)">get</span> the best features, bug fixes, and security patches. If you are unable to upgrade at <span style="color: rgba(0, 0, 255, 1)">this</span> time, paid support <span style="color: rgba(0, 0, 255, 1)">is</span> available <span style="color: rgba(0, 0, 255, 1)">for</span> older versions (hapi.im/<span style="color: rgba(0, 0, 0, 1)">commercial).
npm WARN deprecated sntp@</span><span style="color: rgba(128, 0, 128, 1)">1.0</span>.<span style="color: rgba(128, 0, 128, 1)">9</span>: This module moved to @hapi/sntp. Please make sure to <span style="color: rgba(0, 0, 255, 1)">switch</span> over <span style="color: rgba(0, 0, 255, 1)">as</span> <span style="color: rgba(0, 0, 255, 1)">this</span> distribution <span style="color: rgba(0, 0, 255, 1)">is</span><span style="color: rgba(0, 0, 0, 1)"> no longer supported and may contain bugs and critical security issues.
npm WARN deprecated cryptiles@</span><span style="color: rgba(128, 0, 128, 1)">2.0</span>.<span style="color: rgba(128, 0, 128, 1)">5</span>: This version has been deprecated <span style="color: rgba(0, 0, 255, 1)">in</span> accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to <span style="color: rgba(0, 0, 255, 1)">get</span> the best features, bug fixes, and security patches. If you are unable to upgrade at <span style="color: rgba(0, 0, 255, 1)">this</span> time, paid support <span style="color: rgba(0, 0, 255, 1)">is</span> available <span style="color: rgba(0, 0, 255, 1)">for</span> older versions (hapi.im/<span style="color: rgba(0, 0, 0, 1)">commercial).
npm WARN deprecated topo@</span><span style="color: rgba(128, 0, 128, 1)">1.1</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>: This version has been deprecated <span style="color: rgba(0, 0, 255, 1)">in</span> accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to <span style="color: rgba(0, 0, 255, 1)">get</span> the best features, bug fixes, and security patches. If you are unable to upgrade at <span style="color: rgba(0, 0, 255, 1)">this</span> time, paid support <span style="color: rgba(0, 0, 255, 1)">is</span> available <span style="color: rgba(0, 0, 255, 1)">for</span> older versions (hapi.im/<span style="color: rgba(0, 0, 0, 1)">commercial).
npm WARN deprecated hoek@</span><span style="color: rgba(128, 0, 128, 1)">2.16</span>.<span style="color: rgba(128, 0, 128, 1)">3</span>: This version has been deprecated <span style="color: rgba(0, 0, 255, 1)">in</span> accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to <span style="color: rgba(0, 0, 255, 1)">get</span> the best features, bug fixes, and security patches. If you are unable to upgrade at <span style="color: rgba(0, 0, 255, 1)">this</span> time, paid support <span style="color: rgba(0, 0, 255, 1)">is</span> available <span style="color: rgba(0, 0, 255, 1)">for</span> older versions (hapi.im/<span style="color: rgba(0, 0, 0, 1)">commercial).
npm WARN deprecated boom@</span><span style="color: rgba(128, 0, 128, 1)">2.10</span>.<span style="color: rgba(128, 0, 128, 1)">1</span>: This version has been deprecated <span style="color: rgba(0, 0, 255, 1)">in</span> accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to <span style="color: rgba(0, 0, 255, 1)">get</span> the best features, bug fixes, and security patches. If you are unable to upgrade at <span style="color: rgba(0, 0, 255, 1)">this</span> time, paid support <span style="color: rgba(0, 0, 255, 1)">is</span> available <span style="color: rgba(0, 0, 255, 1)">for</span> older versions (hapi.im/<span style="color: rgba(0, 0, 0, 1)">commercial).
</span>> dtrace-provider@<span style="color: rgba(128, 0, 128, 1)">0.8</span>.<span style="color: rgba(128, 0, 128, 1)">7</span> install C:\Users\admin\Desktop\react-devtools\node_modules\dtrace-<span style="color: rgba(0, 0, 0, 1)">provider
</span>> node-gyp rebuild || node suppress-<span style="color: rgba(0, 0, 0, 1)">error.js
C:\Users\admin\Desktop\react</span>-devtools\node_modules\dtrace-provider><span style="color: rgba(0, 0, 255, 1)">if</span> not defined npm_config_node_gyp (node <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js</span><span style="color: rgba(128, 0, 0, 1)">"</span> rebuild )<span style="color: rgba(0, 0, 255, 1)">else</span> (node <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> rebuild )
gyp ERR</span>!<span style="color: rgba(0, 0, 0, 1)"> configure error
gyp ERR</span>! stack Error: Can<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">t find Python executable "python", you can set the PYTHON env variable.</span>
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:<span style="color: rgba(128, 0, 128, 1)">484</span>:<span style="color: rgba(128, 0, 128, 1)">19</span><span style="color: rgba(0, 0, 0, 1)">)
gyp ERR</span>! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:<span style="color: rgba(128, 0, 128, 1)">509</span>:<span style="color: rgba(128, 0, 128, 1)">16</span><span style="color: rgba(0, 0, 0, 1)">)
gyp ERR</span>! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:<span style="color: rgba(128, 0, 128, 1)">284</span>:<span style="color: rgba(128, 0, 128, 1)">29</span><span style="color: rgba(0, 0, 0, 1)">
gyp ERR</span>! stack at FSReqWrap.oncomplete (fs.js:<span style="color: rgba(128, 0, 128, 1)">153</span>:<span style="color: rgba(128, 0, 128, 1)">21</span><span style="color: rgba(0, 0, 0, 1)">)
gyp ERR</span>! System Windows_NT <span style="color: rgba(128, 0, 128, 1)">10.0</span>.<span style="color: rgba(128, 0, 128, 1)">17134</span><span style="color: rgba(0, 0, 0, 1)">
gyp ERR</span>! command <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">C:\\Program Files\\nodejs\\node.exe</span><span style="color: rgba(128, 0, 0, 1)">"</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js</span><span style="color: rgba(128, 0, 0, 1)">"</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">rebuild</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
gyp ERR</span>! cwd C:\Users\admin\Desktop\react-devtools\node_modules\dtrace-<span style="color: rgba(0, 0, 0, 1)">provider
gyp ERR</span>! node -v v10.<span style="color: rgba(128, 0, 128, 1)">15.3</span><span style="color: rgba(0, 0, 0, 1)">
gyp ERR</span>! node-gyp -v v3.<span style="color: rgba(128, 0, 128, 1)">8.0</span><span style="color: rgba(0, 0, 0, 1)">
gyp ERR</span>!<span style="color: rgba(0, 0, 0, 1)"> not ok
</span>> command-join@<span style="color: rgba(128, 0, 128, 1)">2.0</span>.<span style="color: rgba(128, 0, 128, 1)">1</span> postinstall C:\Users\admin\Desktop\react-devtools\node_modules\command-<span style="color: rgba(0, 0, 0, 1)">join
</span>> npx -p @seangenabe/tnx tnx || exit <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
npx: </span><span style="color: rgba(128, 0, 128, 1)">1</span> 安装成功,用时 <span style="color: rgba(128, 0, 128, 1)">3.104</span><span style="color: rgba(0, 0, 0, 1)"> 秒
Thanks </span><span style="color: rgba(0, 0, 255, 1)">for</span> installing command-join!<span style="color: rgba(0, 0, 0, 1)">
If you like </span><span style="color: rgba(0, 0, 255, 1)">this</span><span style="color: rgba(0, 0, 0, 1)"> package, be sure to star its repo,
and please consider donating:
https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">seangenabe.netlify.com/donate</span>
> core-js@<span style="color: rgba(128, 0, 128, 1)">2.6</span>.<span style="color: rgba(128, 0, 128, 1)">9</span> postinstall C:\Users\admin\Desktop\react-devtools\node_modules\core-<span style="color: rgba(0, 0, 0, 1)">js
</span>> node scripts/postinstall || echo <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">ignore</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
Thank you </span><span style="color: rgba(0, 0, 255, 1)">for</span> <span style="color: rgba(0, 0, 255, 1)">using</span> core-js ( https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/zloirock/core-js ) for polyfilling JavaScript standard library!</span>
<span style="color: rgba(0, 0, 0, 1)">
The project needs your help</span>! Please consider supporting of core-<span style="color: rgba(0, 0, 0, 1)">js on Open Collective or Patreon:
</span>> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">opencollective.com/core-js</span>
> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">www.patreon.com/zloirock</span>
<span style="color: rgba(0, 0, 0, 1)">
Also, the author of core</span>-js ( https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/zloirock ) is looking for a good job -)</span>
> core-js-pure@<span style="color: rgba(128, 0, 128, 1)">3.1</span>.<span style="color: rgba(128, 0, 128, 1)">4</span> postinstall C:\Users\admin\Desktop\react-devtools\node_modules\core-js-<span style="color: rgba(0, 0, 0, 1)">pure
</span>> node scripts/postinstall || echo <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">ignore</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
Thank you </span><span style="color: rgba(0, 0, 255, 1)">for</span> <span style="color: rgba(0, 0, 255, 1)">using</span> core-js ( https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/zloirock/core-js ) for polyfilling JavaScript standard library!</span>
<span style="color: rgba(0, 0, 0, 1)">
The project needs your help</span>! Please consider supporting of core-<span style="color: rgba(0, 0, 0, 1)">js on Open Collective or Patreon:
</span>> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">opencollective.com/core-js</span>
> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">www.patreon.com/zloirock</span>
<span style="color: rgba(0, 0, 0, 1)">
Also, the author of core</span>-js ( https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/zloirock ) is looking for a good job -)</span>
> spawn-sync@<span style="color: rgba(128, 0, 128, 1)">1.0</span>.<span style="color: rgba(128, 0, 128, 1)">15</span> postinstall C:\Users\admin\Desktop\react-devtools\node_modules\spawn-<span style="color: rgba(0, 0, 0, 1)">sync
</span>><span style="color: rgba(0, 0, 0, 1)"> node postinstall
npm notice created a lockfile </span><span style="color: rgba(0, 0, 255, 1)">as</span> package-<span style="color: rgba(0, 0, 255, 1)">lock</span>.json. You should commit <span style="color: rgba(0, 0, 255, 1)">this</span><span style="color: rgba(0, 0, 0, 1)"> file.
npm WARN ajv</span>-errors@<span style="color: rgba(128, 0, 128, 1)">1.0</span>.<span style="color: rgba(128, 0, 128, 1)">1</span> requires a peer of ajv@>=<span style="color: rgba(128, 0, 128, 1)">5.0</span>.<span style="color: rgba(128, 0, 128, 1)">0</span> but none <span style="color: rgba(0, 0, 255, 1)">is</span><span style="color: rgba(0, 0, 0, 1)"> installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@</span><span style="color: rgba(128, 0, 128, 1)">1.2</span>.<span style="color: rgba(128, 0, 128, 1)">9</span><span style="color: rgba(0, 0, 0, 1)"> (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform </span><span style="color: rgba(0, 0, 255, 1)">for</span> fsevents@<span style="color: rgba(128, 0, 128, 1)">1.2</span>.<span style="color: rgba(128, 0, 128, 1)">9</span>: wanted {<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">os</span><span style="color: rgba(128, 0, 0, 1)">"</span>:<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">darwin</span><span style="color: rgba(128, 0, 0, 1)">"</span>,<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">arch</span><span style="color: rgba(128, 0, 0, 1)">"</span>:<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">any</span><span style="color: rgba(128, 0, 0, 1)">"</span>} (current: {<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">os</span><span style="color: rgba(128, 0, 0, 1)">"</span>:<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">win32</span><span style="color: rgba(128, 0, 0, 1)">"</span>,<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">arch</span><span style="color: rgba(128, 0, 0, 1)">"</span>:<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">x64</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">})
added </span><span style="color: rgba(128, 0, 128, 1)">1781</span> packages <span style="color: rgba(0, 0, 255, 1)">from</span> <span style="color: rgba(128, 0, 128, 1)">819</span> contributors and audited <span style="color: rgba(128, 0, 128, 1)">32379</span> packages <span style="color: rgba(0, 0, 255, 1)">in</span> <span style="color: rgba(128, 0, 128, 1)">131</span><span style="color: rgba(0, 0, 0, 1)">.133s
found </span><span style="color: rgba(128, 0, 128, 1)">76</span> vulnerabilities (<span style="color: rgba(128, 0, 128, 1)">66</span> low, <span style="color: rgba(128, 0, 128, 1)">7</span> moderate, <span style="color: rgba(128, 0, 128, 1)">2</span> high, <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)"> critical)
run `npm audit fix` to fix them, or `npm audit` </span><span style="color: rgba(0, 0, 255, 1)">for</span> details</pre>
</div>
<p>直接忽略了。。继续下一步。</p>
<p> </p>
<p>3.打包一份扩展程序。如下:</p>
<div class="cnblogs_code">
<pre>npm run build:extension:chrome</pre>
</div>
<p>结果:</p>
<p><img src="https://img2018.cnblogs.com/blog/1716959/201908/1716959-20190803173217867-106142826.png"></p>
<p>这个时候就可以在react-devtools目录下找到shells--chrome--build--unpacked文件夹。</p>
<p> </p>
<p>4.打开chrome,地址栏输出:chrome://extensions/。 左上角点击加载已解压的扩展程序。把unpacked文件夹放进去了。</p>
<p>大功告成,右上角多了个react图标。</p>
<p><img src="https://img2018.cnblogs.com/blog/1716959/201908/1716959-20190803173804019-1290865035.png"></p>
<p> </p><br><br>
来源:https://www.cnblogs.com/caimuguodexiaohongmao/p/11295597.html
頁:
[1]