mac web开发_如何设置Mac进行Web开发

mac web开发

While you can build basic websites with nothing more than a text editor and browser, you may want to up your game by adding a JavaScript framework like React or Vue and useful tools like Git to your workflow.

虽然可以只使用文本编辑器和浏览器来构建基本网站,但您可能希望通过向工作流程中添加JavaScript框架(如React或Vue)和有用的工具(如Git)来完善自己的游戏。

But wait! Your Mac isn’t ready. Before diving in, you’ll need to install a few items to that will save you from confusing errors later. 😩

可是等等! 您的Mac尚未准备就绪。 在开始之前,您需要安装一些物品,以免日后混淆错误。 😩

This article will guide you through the minimum setup you’ll need to get up and running with JavaScript-based web development on your Mac.

本文将指导您完成在Mac上启动和运行基于JavaScript的Web开发所需的最低设置。

Let’s go!

我们走吧!

更新您的Mac (Update Your Mac)

Before installing any new software, follow these instructions from Apple to upgrade macOS and your current software to the latest version.

在安装任何新软件之前,请按照Apple的这些说明将macOS和您当前的软件升级到最新版本。

选择一个终端应用 (Choose a Terminal App)

Since you’ll be interacting with your Mac using the command line in this article, you’ll need a terminal app.

由于您将使用本文中的命令行与Mac进行交互,因此需要一个终端应用程序。

Any of the following are good options:

以下任何一种都是不错的选择:

  • Hyper

  • iTerm2

    iTerm2

  • Visual Studio Code’s integrated terminal

    Visual Studio Code的集成终端

  • Terminal (the default app that comes with your Mac)

    终端机 (Mac随附的默认应用程序)

If you aren’t sure which one to pick, choose Hyper.

如果您不确定该选择哪一个,请选择“超级”。

命令行开发人员工具 (Command Line Developer Tools)

The first thing you’ll need to install from the command line are your Mac’s command line developer tools. Installing these now will prevent weird errors later.

您需要从命令行安装的第一件事是Mac的命令行开发人员工具 。 现在安装这些将防止以后出现奇怪的错误 。

To check if the tools are already installed, type the following command in your terminal app and hit return:

要检查工具是否已经安装,请在终端应用程序中键入以下命令,然后按回车键:

xcode-select --version

If the result is not a version number, install the tools with this command:

如果结果不是版本号,请使用以下命令安装工具:

xcode-select --install

A dialog will appear asking if you’d like to install the tools. Click Install and the package will download and install itself.

将出现一个对话框,询问您是否要安装工具。 单击安装 ,该软件包将下载并自行安装。

When the installation finishes, confirm the tools are now installed by rerunning the first command:

安装完成后,通过重新运行第一个命令来确认现在已安装工具:

xcode-select --version

The result should now be a version number.

结果现在应该是版本号。

家酿 (Homebrew)

Instead of installing the next few tools by going to each tool’s website, finding the download page, clicking the download link, unzipping the files, and manually running the installer, we’re going to use Homebrew.

我们将使用Homebrew ,而不是通过访问每个工具的网站来安装接下来的几个工具,找到下载页面,单击下载链接,解压缩文件,然后手动运行安装程序。

Homebrew is a tool that lets you install, update and uninstall software on your Mac from the command line. This is faster and safer than the manual approach and generally makes your development life easier.

Homebrew是一种工具,可让您从命令行在Mac上安装,更新和卸载软件。 这比手动方法更快, 更安全 ,并且通常使您的开发工作更轻松。

First, check if Homebrew is already installed:

首先,检查是否已安装Homebrew:

brew --version

If you don’t see a version number, install Homebrew with this command:

如果看不到版本号,请使用以下命令安装Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

I promise that’s the weirdest command you’ll see in this article! 😅 Thanks to Homebrew, the rest are simple.

我保证这是您在本文中看到的最奇怪的命令! Home多亏了Homebrew,其余的都很简单。

Before moving on, confirm Homebrew is now installed:

在继续之前,请确认已安装Homebrew:

brew --version

节点和npm (Node and npm)

Node.js is a tool that allows your Mac to run JavaScript code outside of a web browser. If you want to run a JavaScript framework like React or Vue on your Mac, you’ll need to have Node installed.

Node.js是使您的Mac可以在Web浏览器之外运行JavaScript代码的工具。 如果要在Mac上运行React或Vue这样JavaScript框架,则需要安装Node。

Node also includes npm (the Node Package Manager), which gives you access to a giant library of free code you can download and use in your projects.

Node还包括npm (节点程序包管理器),它使您可以访问庞大的免费代码库,您可以在项目中下载和使用这些代码。

First, check if Node is already installed:

首先,检查是否已安装Node:

node --version

If not, install it with Homebrew:

如果没有,请使用Homebrew安装它:

brew install node

Finally, confirm Node and npm are now installed:

最后,确认已安装Node和npm:

node --version
npm --version

使用Git进行版本控制 (Version Control with Git)

Git is a tool that helps you track changes to your code and work with other developers on shared projects.

Git是一个工具,可帮助您跟踪代码更改并与其他开发人员一起处理共享项目。

Using Git on every project is a great habit to develop and will prepare you for future projects where Git may be required. Some tools (like GatsbyJS) also depend on Git being installed on your Mac, so you’ll need it even if you don’t plan to add it to your workflow.

在每个项目上使用Git是一个很好的养成习惯,它将为将来可能需要Git的项目做准备。 一些工具(例如GatsbyJS )也依赖于Mac上安装的Git,因此即使您不打算将其添加到工作流中,也需要它。

Once again, start by checking if Git is already installed:

再次从检查是否已安装Git开始:

git --version

If not, install it:

如果没有,请安装它:

brew install git

And confirm the installation worked:

并确认安装成功:

git --version

Once in a while, run the following command and everything you’ve installed with Homebrew will update automatically:

偶尔运行以下命令,您通过Homebrew安装的所有内容都会自动更新:

brew update && brew upgrade && brew cleanup && brew doctor

That one command is all you need to keep your system up to date. 🙌

只需执行该命令即可使系统保持最新状态。 🙌

I usually run it when I start a new project, but feel free to do so whenever you like. (When you run this command, if Homebrew suggests additional commands for you to run, go ahead and run them. If a command begins with sudo and you are prompted for a password, use your Mac’s admin password.)

我通常在启动新项目时运行它,但是随时随地都可以运行。 (运行此命令时,如果Homebrew建议您运行其他命令,请继续运行它们。如果命令以sudo开头,并且提示您输入密码,请使用Mac的管理员密码。)

That’s it for the command line!

命令行就是这样!

代码编辑器 (Code Editor)

While you can write code in any text editor, using one that highlights and validates your code will make your life much easier.

虽然您可以在任何文本编辑器中编写代码,但使用突出显示并验证代码的编辑器将使您的工作变得更加轻松。

Any of the following are good options:

以下任何一种都是不错的选择:

  • Visual Studio Code

    Visual Studio程式码

  • Atom

    原子

  • Sublime Text

    崇高文字

If you’re just getting started, choose Visual Studio Code.

如果您只是入门,请选择“ Visual Studio代码”。

浏览器 (Browser)

As you code, it helps to view the app or website you’re building in a browser to confirm it works. While you can use any browser for this, some include extra developer tools that show you details about your code and how to improve it.

在编写代码时,它有助于在浏览器中查看正在构建的应用程序或网站,以确认其正常工作。 尽管您可以使用任何浏览器来实现此目的,但其中一些浏览器还包括其他开发人员工具,这些工具可以为您显示有关代码及其改进方法的详细信息。

Either of the following are good options:

以下任一项都是不错的选择:

  • Chrome

    Chrome

  • Firefox

    火狐浏览器

If you’re just getting started, choose Chrome.

如果您只是入门,请选择Chrome。

发现者 (Finder)

A quick tip here: you’ll want to show the files your Mac hides by default. (For example, git files are automatically hidden, but sometimes you’ll want to edit them.)

快速提示:默认情况下,您要显示Mac隐藏的文件。 (例如,git文件会自动隐藏,但有时您需要对其进行编辑。)

The easiest way to show your Mac’s hidden files is with the keyboard shortcut ⌘⇧. (Command + Shift + Period). This will alternate between showing and hiding these files so you can access them when you need them.

显示Mac隐藏文件的最简单方法是使用键盘快捷键⌘⇧。 (命令+ Shift +句号)。 这将在显示和隐藏这些文件之间交替,因此您可以在需要时访问它们。

结论 (Conclusion)

You’re all set! 🎉

你们都准备好了! 🎉

That’s all you need to get up and running with JavaScript-based front-end development on your Mac.

这就是在Mac上启动并运行基于JavaScript的前端开发所需要的全部内容。

To prevent confusion, I left out any items that aren’t strictly required. If you’d like to dive deeper into optional ways you can further customize your Mac for web development, check out the links below.

为避免混淆,我将所有非严格要求的项目都省略了。 如果您想更深入地研究可选方式,可以进一步自定义Mac以进行Web开发,请查看以下链接。

进一步阅读 (Further Reading)

  • Setting up a Brand New Mac for Development by Tania Rascia

    塔尼亚·拉斯西亚(Tania Rascia) 搭建了全新的Mac进行开发

  • Setting up a MacBook for Front-End Development by Ben Honeywill

    设置MacBook进行前端开发作者:Ben Honeywill

  • Leaving Homestead: Finding the Best All-Around Local Development Environment by WebDevStudios (in case you need a PHP setup as well)

    离开家园:通过WebDevStudios 找到最佳的全方位本地开发环境 (如果您还需要安装PHP)

Discuss on Twitter

在Twitter上讨论



Originally published at michaeluloth.com.

最初在michaeluloth.com上发布。

翻译自: https://www.freecodecamp.org/news/how-to-set-up-your-mac-for-web-development-b40bebc0cac3/

mac web开发

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/392931.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

OpenGL研究3.0 多边形区域填充

OpenGL研究3.0 多边形区域填充 DionysosLai(906391500qq.com)2014-06-22 所谓多边形区域填充。就是将多边形内部区域,所有已相同色块填充。注意:这里讨论的多边形是简单多边形(即不考虑诸如五角星这样的相交多边形)。简单多边形&a…

[转]Android笔记:ScrollView嵌套ViewPager的滚动冲突解决方法

12345678910111213141516171819202122232425262728293031323334/*** 能够兼容ViewPager的ScrollView * Description: 解决了ViewPager在ScrollView中的滑动反弹问题 */ public class ScrollViewExtend extends ScrollView { // 滑动距离及坐标 private float xDistance, yDista…

android tv 乐视手机,乐视超4系列原生Android TV分享

固件:Official USA Firmware:USA BIN Firmware 5.8.050S_1028://mega.nz/#F!7PhyDI6D!TnwNlMmWXosK1uCUdpyNGg[/url]USA ZIP Firmware 5.8.056S_0420 (OTA ZIP, must be flashed only after flashing the above bin)://drive.google.com/open?id1N9...rNHVB_-VPIad…

ping、网络抖动与丢包

基本概念: ping: PING指一个数据包从用户的设备发送到测速点,然后再立即从测速点返回用户设备的来回时间。也就是俗称的“网络延迟” 一般以毫秒(ms)计算 一般PING在0~100ms都是正常的速度,不会有较为明显的卡顿。 测试…

Webtask后端即服务:无服务器快速教程

查尔斯厄勒(Charles Ouellet) (By Charles Ouellet) The word serverless is buzzing through dozens of dev circles today.如今, 无服务器一词正在数十个开发界中流行。 It has been for a while now.已经有一段时间了。 I’ve been meaning to exit my code ed…

leetcode145. 二叉树的后序遍历(dfs)

给定一个二叉树&#xff0c;返回它的 后序 遍历。示例:输入: [1,null,2,3] 1\2/3 输出: [3,2,1]class Solution {List<Integer> listnew ArrayList<>();public List<Integer> postorderTraversal(TreeNode root) {getPostorderTraversal(root);return list;…

[luoguP2801] 教主的魔法(二分 + 分块)

传送门 以为对于这类问题线段树都能解决&#xff0c;分块比线段树菜&#xff0c;结果培训完才知道线段树是一种特殊的分块方法&#xff0c;有的分块的题线段树不能做&#xff0c;看来分块还是有必要学的。 对于这个题&#xff0c;先分块&#xff0c;然后另开一个数组对于每个块…

鸿蒙系统适配开发,捕获科技拟建立鸿蒙开发组 为区块链钱包客户适配鸿蒙系统做筹备...

遭遇美国“实体清单”封杀的第85天&#xff0c;华为“鸿蒙”横空出世&#xff01;8月9日下午&#xff0c;在华为全球开发者大会上&#xff0c;当余承东正式宣布鸿蒙系统(Harmony OS)发布的时候&#xff0c;全场掌声雷动&#xff01;世界上第一个由中国企业自主研发的全平台微内…

[arm驱动]linux内核中断编程

第一部分获取中断(开启硬件中断)一、中断的申请注销: 1&#xff09;中断的申请 12int request_irq(unsigned int irq, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id) 2)中断的注销 1void free_irq(unsigned int irq, void *dev_id) 3&am…

关于VCP(Virtual Com Port)拓展的调试经历(一)

* The Overview 前日&#xff0c;接到老板部署的任务&#xff0c;将现有的基于STM32L151与L432的LoRaWAN程序中添加USB CDC(Communication Device Class)功能&#xff0c;并枚举为VCP(Virtual Com Port)用以替代以往的串口打印。很疑惑为什么以前架构代码的时候没有添加进去。。…

leetcode701. 二叉搜索树中的插入操作(dfs)

给定二叉搜索树&#xff08;BST&#xff09;的根节点和要插入树中的值&#xff0c;将值插入二叉搜索树。 返回插入后二叉搜索树的根节点。 输入数据保证&#xff0c;新值和原始二叉搜索树中的任意节点值都不同。注意&#xff0c;可能存在多种有效的插入方式&#xff0c;只要树在…

三星s6 android 8.0,再见Android 8.0,三星s6全系列系统都停止了,第一代国王已经倒下了吗?...

对于Android用户而言&#xff0c;最令人兴奋的事情是系统更新&#xff0c;因为该更新意味着更流畅的体验和更加用户友好的功能. 但是&#xff0c;旧的三星S6并不是那么幸运&#xff0c;并且不再错过Android 8.0.三星s6的全系列指的是三星s6&#xff0c;三星s6 edge&#xff0c;…

devise tree_Devise如何确保您的Rails应用密码安全

devise treeby Tiago Alves由蒂亚戈阿尔维斯(Tiago Alves) Devise如何确保您的Rails应用密码安全 (How Devise keeps your Rails app passwords safe) Devise is an incredible authentication solution for Rails with more than 40 million downloads. However, since it ab…

Exchange 2010无法安装问题解决方法

当你在活动目录(AD)森林中安装多台全局编录服务器(GC)之后,默认情况下你会发现在AD站点里面自动生成二条站点连接,从上面的截图可以看到目前在AD森林的Default-First-Site-Name(默认站点)里面有6台GC。 从上面的截图可以看到目前只有一台叫做Sh-Site1GC(全局编录服务器)是处于运…

android edittext 不滚动,EditText 设置可以垂直滑动但是不可输入

一、前言&#xff1a;android:id"id/edtInput"android:layout_width"match_parent"android:layout_height"60dp"android:background"drawable/round_theme_3_gray"android:gravity"top"android:hint"string/please_inp…

snmpd修改端口

http://blog.csdn.net/cau99/article/details/5077239 http://blog.csdn.net/gua___gua/article/details/48547701转载于:https://www.cnblogs.com/diyunpeng/p/6829592.html

leetcode LCP 19. 秋叶收藏集(dp)

小扣出去秋游&#xff0c;途中收集了一些红叶和黄叶&#xff0c;他利用这些叶子初步整理了一份秋叶收藏集 leaves&#xff0c; 字符串 leaves 仅包含小写字符 r 和 y&#xff0c; 其中字符 r 表示一片红叶&#xff0c;字符 y 表示一片黄叶。 出于美观整齐的考虑&#xff0c;小扣…

步进电机 步距角 编码器_我如何迈出了学习编码的第一步

步进电机 步距角 编码器A couple of months ago, I was chatting to a developer at work about how I’ve always wanted to learn to code but never tried.几个月前&#xff0c;我正在与一个开发人员聊天&#xff0c;讨论我一直想学习编码但从未尝试过的方法。 Coding alwa…

第五章:配置使用FastJson返回Json视图

fastJson是阿里巴巴旗下的一个开源项目之一&#xff0c;顾名思义它专门用来做快速操作Json的序列化与反序列化的组件。它是目前json解析最快的开源组件没有之一&#xff01;在这之前jaskJson是命名为快速操作json的工具&#xff0c;而当阿里巴巴的fastJson诞生后jaskjson就消声…

一加6android9玩飞车掉,解锁新速度:一加6T深度评测

解锁新速度&#xff1a;一加6T深度评测2019-11-02 14:28:595点赞2收藏4评论创作立场声明&#xff1a;我们只谈智能硬件&#xff0c;向改变生活的智能硬件Say“嗨”&#xff01;作为安卓旗舰机成员&#xff0c;一加这个品牌在玩机一类的同学手里可是大放光彩&#xff0c;各种刷机…