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.pswp.cn/news/392931.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/392931.shtml
英文地址,請注明出處:http://en.pswp.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;各種刷機…