godaddy-nodejs-hosting
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoDaddy Node.js Hosting
GoDaddy Node.js托管
Help users build or fix Node.js apps for GoDaddy Node.js Hosting (upload → install → → ). Package manager: npm, pnpm, or yarn (lockfile determines platform choice).
run buildrun startRules: contract.md. Recipes: examples.md. Errors: troubleshooting.md. Validator: scripts/validate-paas.mjs.
帮助用户为GoDaddy Node.js托管构建或修复Node.js应用(上传 → 安装 → → )。包管理器支持:npm、pnpm或yarn(锁文件决定平台选择)。
run buildrun start规则:contract.md。方案:examples.md。错误排查:troubleshooting.md。验证工具:scripts/validate-paas.mjs。
When to use which path
场景路径选择
| User intent | Section |
|---|---|
| New app / scaffold / greenfield | New app workflow |
| Existing repo / deploy failed / make this work on hosting | Adapting an existing app |
| AI export (Lovable, Replit, Bolt, etc.) | Adapting an existing app + AI export quick fixes |
Audience routing
用户群体指引
Non-technical user (no jargon, “I built this in Lovable”, “how do I upload”):
- Output the pre-upload checklist first in plain language.
- Follow Adapting an existing app (existing zip or export).
- Prefer the static SPA + Express or static only recipe when there is no server.
- One small change at a time; explain what to zip and upload.
- Run the validator before saying the app is ready.
Technical user - existing app: follow Adapting an existing app; use the matching framework recipe for / only; do not re-explaining basics.
startbuildTechnical user - new app: follow New app workflow; use the matching framework recipe from Framework detection.
Deploy contract (summary)
部署协议(摘要)
- Root with
package.json,name,version(file exists),main, andscripts.buildscripts.start - may be
buildwhen nothing compiles; frameworks need real build commands (examples.md)"echo build" - Listen on ; use
process.env.PORTwhen the framework needs a host0.0.0.0 - Runtime deps in ; do not upload
dependenciesnode_modules - Secrets via ; no
process.envin zip; zip under 100 MB.env - One app per upload; lockfile when possible
- Outbound HTTP/HTTPS only; platform MySQL via env +
DB_*if using a database (contract.md)mysql2
- 根目录下的需包含
package.json、name、version(对应文件需存在)、main和scripts.build字段scripts.start - 当无需编译时,脚本可设为
build;框架类应用需使用真实的构建命令(参考examples.md)"echo build" - 监听;当框架需要指定主机时,使用
process.env.PORT0.0.0.0 - 运行时依赖需放在中;请勿上传
dependenciesnode_modules - 通过管理密钥;压缩包中不要包含
process.env文件;压缩包大小需小于100 MB.env - 每次上传仅包含一个应用;尽可能包含锁文件
- 仅允许出站HTTP/HTTPS请求;如需使用数据库,平台MySQL需通过环境变量 +
DB_*连接(参考contract.md)mysql2
Adapting an existing app
适配现有应用
Use this path when the user already has a project (local repo, zip export, or app that failed on Node.js Hosting). Goal: hosting compatibility only — not new features, refactors, or framework changes.
当用户已有项目(本地仓库、压缩包导出或在Node.js托管平台部署失败的应用)时使用此流程。目标:仅保证托管兼容性——不添加新功能、不重构、不更改框架。
Principles
原则
- Do not add or remove product features; do not refactor unrelated code.
- Smallest diff: prefer (
package.json,name,version,main,build), listen/bind lines, and a static server file when missing — not rewriting app logic.start - Keep the detected framework; align ,
main, andscripts.startwith examples.md for that stack only.scripts.build
- 请勿添加或移除产品功能;请勿重构无关代码。
- 最小化改动:优先修改(
package.json、name、version、main、build)、监听/绑定代码,以及在缺少时添加静态服务器文件——而非重写应用逻辑。start - 保留检测到的框架;仅针对该技术栈,将、
main和scripts.start与examples.md中的方案对齐。scripts.build
Adaptation workflow
适配流程
Audit against contract.md (nine platform requirements: fields, /, PORT, deps, env vars, Vite, zip size, network, MySQL). For each item: check compliance, apply the smallest fix, preserve all existing behaviour.
package.jsonbuildstartCopy and track progress:
- [ ] Run validator on project root (baseline)
- [ ] Map each error/warning to contract rule (see table below)
- [ ] Apply minimal fix per ID; use framework recipe for script names only
- [ ] Re-run validator until exit 0 (or document warnings if not --strict)
- [ ] install → build → start locally (match lockfile package manager)
- [ ] Pre-upload checklist completeValidator (required before done):
bash
node scripts/validate-paas.mjs /path/to/projectRun from this skill directory (e.g. after or symlink to ). From a clone of nodejs-hosting-agent-skill: .
npx skills add~/.cursor/skills/godaddy-nodejs-hostingnpm run validate -- /path/to/projectSymptom detail: troubleshooting.md.
| ID | Typical minimal fix |
|---|---|
| E001 | Add root |
| E002 | Add or fix |
| E003 | Fix |
| E004 | Use |
| E005 | Add |
| E006 | Move runtime packages to |
| E007 | Add |
| E008 | Add |
| W001 | Remove |
| W002 | Optional: add |
| W004 | Remove |
Special cases
- Monorepo (C1): extract a single app folder with its own root before adapting; do not restructure packages in place unless the user asks.
package.json - Frontend-only / no server: vite-react-vue-spa and AI export quick fixes.
- Migrating from another host: same steps; focus on ,
PORT/start,build, and lockfile.dependencies
For Replit, Lovable, and Bolt patterns, see AI export quick fixes after applying this workflow.
Adaptation is complete under the same done criteria as a new app (validator , checklist, zip the project root).
0对照contract.md进行检查(平台的九项要求:字段、/脚本、PORT、依赖、环境变量、Vite、压缩包大小、网络、MySQL)。针对每一项:检查合规性,应用最小化修复,保留所有现有行为。
package.jsonbuildstart复制并跟踪进度:
- [ ] 在项目根目录运行验证工具(基准检查)
- [ ] 将每个错误/警告映射到协议规则(见下表)
- [ ] 针对每个ID应用最小化修复;仅使用框架方案中的脚本名称
- [ ] 重新运行验证工具直至退出码为0(如未使用--strict模式,可记录警告)
- [ ] 本地执行install → build → start(匹配锁文件对应的包管理器)
- [ ] 完成上传前检查清单验证工具(完成前必须运行):
bash
node scripts/validate-paas.mjs /path/to/project从本技能目录运行(例如执行后,或链接到)。从nodejs-hosting-agent-skill克隆的仓库中,可执行:。
npx skills add~/.cursor/skills/godaddy-nodejs-hostingnpm run validate -- /path/to/project症状详情:troubleshooting.md。
| ID | 典型最小化修复 |
|---|---|
| E001 | 添加根目录 |
| E002 | 根据方案添加或修复 |
| E003 | 修复 |
| E004 | 使用 |
| E005 | 添加 |
| E006 | 将运行时包移至 |
| E007 | 为 |
| E008 | 添加指向现有入口文件的 |
| W001 | 从上传包中移除 |
| W002 | 可选:添加 |
| W004 | 从上传压缩包中移除 |
特殊情况
- 单仓库多项目(C1):在适配前提取单个应用文件夹(需包含自身根目录);除非用户要求,否则请勿原地重构包结构。
package.json - 仅前端/无服务器端:参考vite-react-vue-spa和AI导出快速修复。
- 从其他托管平台迁移:执行相同步骤;重点关注、
PORT/start脚本、build和锁文件。dependencies
针对Replit、Lovable和Bolt的应用模式,完成此流程后请参考AI导出快速修复。
适配完成的标准与新应用一致(验证工具退出码为0、完成检查清单、压缩项目根目录)。
New app workflow
新应用工作流
Copy and track progress:
- [ ] Detect framework (package.json)
- [ ] Apply recipe from examples.md
- [ ] install && run build (if exists) && run start (npm, pnpm, or yarn — match user's lockfile)
- [ ] node scripts/validate-paas.mjs <project-dir>
- [ ] Pre-upload checklist completeRun the validator as in Adapting an existing app.
复制并跟踪进度:
- [ ] 检测框架(通过package.json)
- [ ] 应用examples.md中的方案
- [ ] 执行install && run build(如存在) && run start(使用npm、pnpm或yarn —— 匹配用户的锁文件)
- [ ] 执行node scripts/validate-paas.mjs <project-dir>
- [ ] 完成上传前检查清单验证工具的运行方式与适配现有应用相同。
Framework detection
框架检测
Signal in | Recipe |
|---|---|
| examples.md#nextjs |
| examples.md#nuxtjs |
| examples.md#remix |
| examples.md#nestjs |
| examples.md#fastify |
| examples.md#vite-react-vue-spa |
| examples.md#create-react-app |
| examples.md#express-koa-hono |
| Frontend-only / unknown export | examples.md#vite-react-vue-spa (static server) |
Do not invent commands for known frameworks; use the recipe exactly.
start | 方案 |
|---|---|
依赖中包含 | examples.md#nextjs |
依赖中包含 | examples.md#nuxtjs |
包含 | examples.md#remix |
包含 | examples.md#nestjs |
包含 | examples.md#fastify |
包含 | examples.md#vite-react-vue-spa |
包含 | examples.md#create-react-app |
包含 | examples.md#express-koa-hono |
| 仅前端/未知导出应用 | examples.md#vite-react-vue-spa(静态服务器) |
请勿为已知框架自定义命令;严格使用方案中的命令。
startAI export quick fixes
AI导出快速修复
| Source | Fix |
|---|---|
| Replit | Remove |
| Lovable / Bolt | Add Express static server for |
Missing | Create with |
| Hardcoded port | Use |
| Wrong deps section | Move runtime packages to |
For Lovable/Bolt static hosting, use the vite-react-vue-spa recipe.
| 来源 | 修复方案 |
|---|---|
| Replit | 移除 |
| Lovable / Bolt | 为 |
缺少 | 创建包含 |
| 硬编码端口 | 使用`process.env.PORT |
| 依赖分类错误 | 将运行时包移至 |
针对Lovable/Bolt的静态托管,使用vite-react-vue-spa方案。
Pre-upload checklist
上传前检查清单
- :
package.json,name,version,main,buildstart - Production deps in ; no
dependenciesin zipnode_modules - for listening; secrets via
process.env.PORTprocess.env - Zip under 100 MB
- Runs locally: install → build → start
- Lockfile in zip; validator exit 0; no
.env - HTTP/HTTPS outbound only; DB uses +
DB_*if applicablemysql2
- :包含
package.json、name、version、main、build字段start - 生产依赖在中;压缩包中无
dependenciesnode_modules - 使用监听;通过
process.env.PORT管理密钥process.env - 压缩包大小小于100 MB
- 本地可正常运行:install → build → start
- 压缩包中包含锁文件;验证工具退出码为0;无文件
.env - 仅允许出站HTTP/HTTPS请求;如需使用数据库,需使用环境变量 +
DB_*mysql2
Done criteria
完成标准
Task is complete only when:
- exits
validate-paas.mjson the project directory.0 - Pre-upload checklist is satisfied.
- User knows to zip the project root (single app folder) for upload.
仅当满足以下所有条件时,任务才算完成:
- 在项目目录运行后退出码为0。
validate-paas.mjs - 满足上传前检查清单的所有要求。
- 用户知晓需压缩项目根目录(单个应用文件夹)进行上传。