0Pricing
Mojo Academy · บทเรียน

การเพิ่มแพ็กเกจ Mojo

ติดตั้ง Mojo ผ่านชุดเครื่องมือ Modular

การเพิ่มแพ็กเกจ Mojo เป็นบทเรียน Mojo Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Mojo Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Mojo Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

The CLI Is Not Mojo Yet

Installing magic gave you the manager, not the language. Now you add Mojo itself into a project through that toolchain. 📦

Projects Hold Your Toolchain

With magic, Mojo lives inside a project folder. Each project gets its own pinned version, so different apps never clash.

Create a New Project

Start by making a project. The magic init command scaffolds a folder ready to hold Mojo and its dependencies.

magic init my-mojo-app

Step Into the Folder

Move into the new directory so the next commands run in the right place. This folder is your project root.

cd my-mojo-app

Add the Mojo Package

Pull Mojo into the project with magic add. This downloads the compiler and standard library as a package the project depends on.

magic add mojo

The Manifest File

Your dependencies are tracked in a pixi.toml manifest. Adding mojo records it there so the setup is reproducible later.

The Lock File

Alongside the manifest sits a lock file pinning exact versions. It guarantees teammates get the very same toolchain you have.

Enter the Environment

Activate the project so its tools are on your PATH. Inside a magic shell, the mojo command becomes available to you.

magic shell

Run Without Activating

Prefer not to enter a shell? Prefix any command with magic run to use the project's Mojo for just that one command.

magic run mojo --version

Mojo Is Now Local

Because Mojo lives in the project, deleting the folder removes it cleanly. Nothing is scattered globally across your system.

Share It with Others

Commit pixi.toml and the lock file to git. A teammate then runs magic install to recreate the exact same Mojo setup.

magic install

Quick Check

Recall the command that pulls Mojo into your project after you create it.

Recap

You ran magic init, then magic add mojo, and the package landed in pixi.toml. Enter it with magic shell to use mojo. 🎯

คำถามที่พบบ่อย

บทเรียน “การเพิ่มแพ็กเกจ Mojo” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การเพิ่มแพ็กเกจ Mojo” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Mojo Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Mojo Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การเพิ่มแพ็กเกจ Mojo”

ติดตั้ง Mojo ผ่านชุดเครื่องมือ Modular คุณปฏิบัติ Mojo Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Mojo Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Mojo Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “การเพิ่มแพ็กเกจ Mojo” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Mojo Academy นี้ได้ไหม

ได้ บทเรียน Mojo Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การติดตั้ง Modular CLI
  2. การเพิ่มแพ็กเกจ Mojo
  3. การตรวจสอบเวอร์ชัน
  4. การตั้งค่าเครื่องมือแก้ไขสำหรับ Mojo
← กลับไปที่ Mojo Academy