meteor-cli-installation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Install and repair the Meteor CLI

安装和修复 Meteor CLI

Make the Meteor CLI available without changing an application or deleting state that the user did not place in scope.
npx meteor
runs the official npm installer and creates a user-wide Meteor installation; it does not add the installer permanently to global npm packages.
让 Meteor CLI 可用,同时不更改应用,也不删除用户未纳入操作范围的状态。
npx meteor
会运行官方 npm 安装器,并创建用户级 Meteor 安装;它不会把安装器永久添加到全局 npm 包中。

Decision flow

决策流程

  1. Classify the request before changing the machine.
    • Install a missing CLI when the user asks to set up Meteor or requests a local create, run, test, build, or deploy operation that requires it.
    • For explanation, review, or planning only, report the missing prerequisite and the install command without running it.
    • Require explicit confirmation before any recovery operation that removes state:
      meteor reset
      ,
      meteor reset --db
      , npm cache clearing, targeted global metadata cleanup, uninstall, or full reinstall.
    • When evidence makes a cleanup or reinstall plausible, suggest the least destructive option with its reason, scope, and expected state loss. Do not execute it until the user explicitly confirms that operation.
  2. Inspect the host and intended project. Check the operating system, architecture,
    node --version
    ,
    npm --version
    , CLI lookup result, and
    meteor --version
    when available. In an application, read
    .meteor/release
    before selecting a release.
  3. Distinguish the requested version:
    • The npm selector in
      npx meteor@<version>
      chooses an installer package.
    • A Meteor application is pinned to a framework release in
      .meteor/release
      . Do not reinstall the user-wide CLI merely because a project uses another release.
  4. For a missing CLI, PATH failure, npm installer failure, or host prerequisite, follow Installation and PATH.
  5. For a project release, cache reset, corrupted dev bundle, uninstall, or clean reinstall, follow Releases, reset, and reinstall. Use Reinstall decision guide before recommending a user-wide reinstall for an observed failure.
  6. Verify the result with
    meteor --version
    . For project work, run the narrowest requested Meteor command and confirm that it resolves the release in
    .meteor/release
    . Report commands run, selected versions, state removed, and anything the user must do in a new shell.
  1. 在更改机器之前,先对请求进行分类。
    • 当用户要求设置 Meteor,或请求需要 CLI 的本地 create、run、test、build 或 deploy 操作时,为缺失的 CLI 执行安装。
    • 如果只是解释、审查或规划,报告缺失的前置条件及安装命令,但不要运行。
    • 对任何会删除状态的恢复操作,都必须事先获得明确确认:
      meteor reset
      、
      meteor reset --db
      、npm 缓存清理、定向全局元数据清理、卸载或完整重装。
    • 当现有证据表明可能需要清理或重装时,应建议破坏性最小的选项,并说明其原因、影响范围和预计会丢失的状态。在用户明确确认该操作之前,不要执行。
  2. 检查主机和目标项目。检查操作系统、架构、
    node --version
    、
    npm --version
    、CLI 查找结果,以及可用时的
    meteor --version
    。在应用中,读取
    .meteor/release
    后再选择 release。
  3. 区分所请求的版本:
    • npx meteor@<version>
      中的 npm 选择器用于选择安装器包。
    • Meteor 应用通过
      .meteor/release
      固定到特定的框架 release。 不要仅仅因为项目使用了其他 release,就重新安装用户级 CLI。
  4. 对于 CLI 缺失、PATH 故障、npm 安装器故障或主机前置条件问题,请遵循安装与 PATH。
  5. 对于项目 release、缓存重置、损坏的 dev bundle、卸载或干净重装,请遵循版本、重置与重装。在针对观察到的故障建议用户级重装之前,先使用重装决策指南。
  6. 使用
    meteor --version
    验证结果。对于项目工作,仅运行用户请求的范围最小的 Meteor 命令,并确认其解析到
    .meteor/release
    中指定的 release。报告已运行的命令、所选版本、已删除的状态,以及用户在新 shell 中必须执行的任何操作。

Installation rules

安装规则

SituationAction
Latest supported CLIRun
npx meteor
.
Pinned installer packageRun
npx meteor@<version> install
, then verify the reported Meteor release.
Linux or macOS alternative
curl https://install.meteor.com/ | sh
remains documented. Keep
npx meteor
as the primary cross-platform command.
npm fallbackRun
npm install -g meteor --foreground-script
only after the documented
npx
recovery steps fail.
Existing project needs another releaseUse the project's pin or a Meteor
--release
command. Do not replace the user-wide installation first.
Never run
npx install meteor
. Never add the npm
meteor
installer to an application's
package.json
; it is an installer, not the framework runtime.
情况操作
最新受支持的 CLI运行
npx meteor
。
固定版本的安装器包运行
npx meteor@<version> install
,然后验证所报告的 Meteor release。
Linux 或 macOS 替代方式
curl https://install.meteor.com/ | sh
仍保留在文档中。仍将
npx meteor
作为主要的跨平台命令。
npm 兜底方案仅在文档列出的
npx
恢复步骤失败后,才运行
npm install -g meteor --foreground-script
。
现有项目需要其他 release使用项目固定的版本或 Meteor 的
--release
命令。不要先替换用户级安装。
绝不运行
npx install meteor
。不要将 npm
meteor
安装器添加到应用的
package.json
中;它是安装器,而不是框架运行时。

State boundaries

状态边界

StateScopeSafe operation
User Meteor directoryDownloaded tools, releases, dev bundles, and CLI state for the user
npx meteor uninstall
removes the whole installation. Use only for an authorized uninstall or clean reinstall.
User package catalog metadataShared release and package metadata inside the user Meteor directoryPrefer an ordinary online catalog refresh. Treat targeted metadata rebuilding as an advanced, confirmation-required recovery.
.meteor/release
Project framework releaseChange through
meteor update --release <release>
, not a global reinstall.
.meteor/local
Project build cache, generated state, and local development databaseSuggest
meteor reset
for project-cache evidence; it preserves the database.
meteor reset --db
deletes it. Run either only after confirmation.
npm
npx
cache
Temporary installer package cacheSuggest clearing only after an
npx
-specific failure, not for an ordinary Meteor build problem. Run only after confirmation.
Do not delete internal tool or dev-bundle directories selectively without a documented command and evidence that identifies that layer. Use
meteor reset
for project cache corruption. Use a complete, authorized reinstall only when the user-wide installation itself is corrupt. Never recommend hidden Meteor administration commands as user-facing cache cleaners.
状态范围安全操作
用户 Meteor 目录为用户下载的工具、release、dev bundle 和 CLI 状态
npx meteor uninstall
会删除整个安装。仅在用户授权卸载或干净重装时使用。
用户包目录元数据用户 Meteor 目录内共享的 release 和包元数据优先使用普通的在线目录刷新。定向重建元数据属于高级恢复操作,需要用户确认。
.meteor/release
项目框架 release通过
meteor update --release <release>
进行更改,而不是进行全局重装。
.meteor/local
项目构建缓存、生成状态和本地开发数据库当证据指向项目缓存时,建议使用
meteor reset
;它会保留数据库。
meteor reset --db
会删除数据库。两者都只能在确认后运行。
npm
npx
缓存
临时安装器包缓存仅在出现
npx
专项故障后建议清理,而不是在普通 Meteor 构建问题发生时清理。仅在确认后运行。
不要在没有文档化命令和能够确定问题层级的证据时,选择性删除内部工具或 dev bundle 目录。对于项目缓存损坏,使用
meteor reset
。仅当用户级安装本身已损坏时,才使用经过授权的完整重装。绝不将隐藏的 Meteor 管理命令作为面向用户的缓存清理方式推荐。

Handoffs

任务移交

  • The CLI starts but the application fails:
    meteor-debugging
    .
  • The application must move from Meteor 2 to Meteor 3:
    migrate-to-meteor-3
    .
  • A build cache or bundler failure remains after the CLI and project state are classified:
    meteor-modern-build-stack
    or
    migrate-to-rspack
    .
  • Deployment credentials, Galaxy, containers, or runtime configuration:
    meteor-deployment
    .
  • CLI 启动后应用仍发生故障:
    meteor-debugging
    。
  • 应用需要从 Meteor 2 迁移到 Meteor 3:
    migrate-to-meteor-3
    。
  • 在 CLI 和项目状态完成分类后,构建缓存或 bundler 故障仍然存在:
    meteor-modern-build-stack
    或
    migrate-to-rspack
    。
  • 部署凭据、Galaxy、容器或运行时配置:
    meteor-deployment
    。

References

参考资料

  • Installation and PATH
  • Releases, reset, and reinstall
  • Reinstall decision guide
  • Evaluation cases
  • 安装与 PATH
  • 版本、重置与重装
  • 重装决策指南
  • 评估用例