很多时候,同一个git库拉下来的代码,在我的电脑上能运行可是在别人的上面就不行,今天在开发这是为啥呢?这肯定和系统环境有关,而系统环境又涉及比较多一些维度,我们如果一个个比较难免会非常浪费时间,这里给大家介绍一款快速查看各个环境变量值得小工具,先上效果:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Memory: 123.50 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.0.0 - /usr/local/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /Users/jianlongnie/.rvm/rubies/ruby-2.7.0/bin/pod
Composer: 1.10.13 - /usr/local/bin/composer
Homebrew: 2.6.2 - /usr/local/bin/brew
Maven: 3.6.3 - /usr/local/maven/bin/mvn
pip2: 20.2.3 - /usr/local/bin/pip2
pip3: 9.0.1 - ~/.pyenv/shims/pip3
RubyGems: 3.1.2 - /Users/jianlongnie/.rvm/rubies/ruby-2.7.0/bin/gem
Utilities:
CMake: 3.18.2 - /usr/local/bin/cmake
Make: 3.81 - /usr/bin/make
GCC: 4.2.1 - /usr/bin/gcc
Git: 2.27.0 - /usr/local/bin/git
Clang: 1100.0.33.17 - /usr/bin/clang
Subversion: 1.10.4 - /usr/bin/svn
FFmpeg: 4.3.1 - /usr/local/bin/ffmpeg
Servers:
Apache: 2.4.34 - /usr/sbin/apachectl
Nginx: 1.19.6 - /usr/local/bin/nginx
Virtualization:
Parallels: 16.1.1 - /usr/local/bin/prlctl
VirtualBox: 6.1.16 - /usr/local/bin/vboxmanage
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Emacs: 26.3 - /usr/local/bin/emacs
IntelliJ: 2018.1.5
Nano: 2.0.6 - /usr/bin/nano
PhpStorm: 2020.2.3
VSCode: 1.52.1 - /usr/local/bin/code
Vim: 8.0 - /usr/bin/vim
Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
Languages:
Bash: 3.2.57 - /bin/bash
Java: 14.0.1 - /usr/bin/javac
Perl: 5.18.4 - /usr/bin/perl
PHP: 7.1.31 - /usr/local/php5/bin/php
Protoc: 3.14.0 - /usr/local/bin/protoc
Python: 3.5.4 - /Users/jianlongnie/.pyenv/shims/python
Python3: 3.5.4 - /Users/jianlongnie/.pyenv/shims/python3
Ruby: 2.7.0 - /Users/jianlongnie/.rvm/rubies/ruby-2.7.0/bin/ruby
Databases:
MongoDB: 4.2.6 - /usr/local/bin/mongo
MySQL: 10.14 - /usr/local/bin/mysql
PostgreSQL: 9.3.5 - /usr/local/php5/bin/postgres
SQLite: 3.24.0 - /usr/bin/sqlite3
Browsers:
Chrome: 87.0.4280.88
Safari: 13.0.5
这是我的最终效果,那会列出来你电脑上所有和开发相关的各个环境变量的值,这样只要比较两台电脑哪些环境变量不一样,就能快速定位问题了。
安装:
npm install -g envinfo || yarn global add envinfo
之后终端运行 envinfo即可!我一般都会把这个信息保存到git里面,后面出问题之后,可以即时恢复正确时候的环境变量,不至于那一天为了运行一次程序配很久很久的环境。
网友评论