godaddy-nodejs-hosting

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GoDaddy Node.js Hosting

GoDaddy Node.js托管

Help users build or fix Node.js apps for GoDaddy Node.js Hosting (upload → install →
run build
run start
). Package manager: npm, pnpm, or yarn (lockfile determines platform choice).
Rules: contract.md. Recipes: examples.md. Errors: troubleshooting.md. Validator: scripts/validate-paas.mjs.
帮助用户为GoDaddy Node.js托管构建或修复Node.js应用(上传 → 安装 →
run build
run start
)。包管理器支持:npmpnpmyarn(锁文件决定平台选择)。
规则:contract.md。方案:examples.md。错误排查:troubleshooting.md。验证工具:scripts/validate-paas.mjs

When to use which path

场景路径选择

User intentSection
New app / scaffold / greenfieldNew app workflow
Existing repo / deploy failed / make this work on hostingAdapting an existing app
AI export (Lovable, Replit, Bolt, etc.)Adapting an existing app + AI export quick fixes
用户意图章节
新应用/脚手架/全新项目新应用工作流
现有仓库/部署失败/适配至托管平台适配现有应用
AI导出应用(Lovable、Replit、Bolt等)适配现有应用 + AI导出快速修复

Audience routing

用户群体指引

Non-technical user (no jargon, “I built this in Lovable”, “how do I upload”):
  1. Output the pre-upload checklist first in plain language.
  2. Follow Adapting an existing app (existing zip or export).
  3. Prefer the static SPA + Express or static only recipe when there is no server.
  4. One small change at a time; explain what to zip and upload.
  5. Run the validator before saying the app is ready.
Technical user - existing app: follow Adapting an existing app; use the matching framework recipe for
start
/
build
only; do not re-explaining basics.
Technical user - new app: follow New app workflow; use the matching framework recipe from Framework detection.
非技术用户(不懂术语,比如“我用Lovable做了这个应用”、“怎么上传”):
  1. 首先用通俗易懂的语言输出上传前检查清单
  2. 遵循适配现有应用流程(针对现有压缩包或导出文件)。
  3. 当无服务器端时,优先选择静态SPA + Express仅静态文件方案。
  4. 每次只做一处小改动;说明需要压缩并上传的内容。
  5. 在确认应用就绪前运行验证工具。
技术用户 - 现有应用:遵循适配现有应用流程;仅针对
start
/
build
脚本使用匹配的框架方案;无需解释基础内容。
技术用户 - 新应用:遵循新应用工作流;根据框架检测结果使用匹配的框架方案。

Deploy contract (summary)

部署协议(摘要)

  • Root
    package.json
    with
    name
    ,
    version
    ,
    main
    (file exists),
    scripts.build
    , and
    scripts.start
  • build
    may be
    "echo build"
    when nothing compiles; frameworks need real build commands (examples.md)
  • Listen on
    process.env.PORT
    ; use
    0.0.0.0
    when the framework needs a host
  • Runtime deps in
    dependencies
    ; do not upload
    node_modules
  • Secrets via
    process.env
    ; no
    .env
    in zip; zip under 100 MB
  • One app per upload; lockfile when possible
  • Outbound HTTP/HTTPS only; platform MySQL via
    DB_*
    env +
    mysql2
    if using a database (contract.md)
  • 根目录下的
    package.json
    需包含
    name
    version
    main
    (对应文件需存在)、
    scripts.build
    scripts.start
    字段
  • 当无需编译时,
    build
    脚本可设为
    "echo build"
    ;框架类应用需使用真实的构建命令(参考examples.md
  • 监听
    process.env.PORT
    ;当框架需要指定主机时,使用
    0.0.0.0
  • 运行时依赖需放在
    dependencies
    中;请勿上传
    node_modules
  • 通过
    process.env
    管理密钥;压缩包中不要包含
    .env
    文件;压缩包大小需小于100 MB
  • 每次上传仅包含一个应用;尽可能包含锁文件
  • 仅允许出站HTTP/HTTPS请求;如需使用数据库,平台MySQL需通过
    DB_*
    环境变量 +
    mysql2
    连接(参考contract.md

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
    ,
    start
    ), listen/bind lines, and a static server file when missing — not rewriting app logic.
  • Keep the detected framework; align
    main
    ,
    scripts.start
    , and
    scripts.build
    with examples.md for that stack only.
  • 请勿添加或移除产品功能;请勿重构无关代码。
  • 最小化改动:优先修改
    package.json
    name
    version
    main
    build
    start
    )、监听/绑定代码,以及在缺少时添加静态服务器文件——而非重写应用逻辑。
  • 保留检测到的框架;仅针对该技术栈,将
    main
    scripts.start
    scripts.build
    examples.md中的方案对齐。

Adaptation workflow

适配流程

Audit against contract.md (nine platform requirements:
package.json
fields,
build
/
start
, PORT, deps, env vars, Vite, zip size, network, MySQL). For each item: check compliance, apply the smallest fix, preserve all existing behaviour.
Copy 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 complete
Validator (required before done):
bash
node scripts/validate-paas.mjs /path/to/project
Run from this skill directory (e.g. after
npx skills add
or symlink to
~/.cursor/skills/godaddy-nodejs-hosting
). From a clone of nodejs-hosting-agent-skill:
npm run validate -- /path/to/project
.
Symptom detail: troubleshooting.md.
IDTypical minimal fix
E001Add root
package.json
E002Add or fix
scripts.start
per recipe
E003Fix
start
entry path or add missing file
E004Use
process.env.PORT
; remove hardcoded
listen(N)
E005Add
scripts.build
(
echo build
or framework recipe)
E006Move runtime packages to
dependencies
E007Add
name
and
version
to
package.json
E008Add
main
pointing at an existing entry file
W001Remove
.env
from upload; use hosting UI for env vars
W002Optional: add
engines.node
W004Remove
node_modules
from upload zip
Special cases
  • Monorepo (C1): extract a single app folder with its own root
    package.json
    before adapting; do not restructure packages in place unless the user asks.
  • Frontend-only / no server: vite-react-vue-spa and AI export quick fixes.
  • Migrating from another host: same steps; focus on
    PORT
    ,
    start
    /
    build
    ,
    dependencies
    , and lockfile.
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
0
, checklist, zip the project root).
对照contract.md进行检查(平台的九项要求:
package.json
字段、
build
/
start
脚本、PORT、依赖、环境变量、Vite、压缩包大小、网络、MySQL)。针对每一项:检查合规性,应用最小化修复,保留所有现有行为。
复制并跟踪进度:
- [ ] 在项目根目录运行验证工具(基准检查)
- [ ] 将每个错误/警告映射到协议规则(见下表)
- [ ] 针对每个ID应用最小化修复;仅使用框架方案中的脚本名称
- [ ] 重新运行验证工具直至退出码为0(如未使用--strict模式,可记录警告)
- [ ] 本地执行install → build → start(匹配锁文件对应的包管理器)
- [ ] 完成上传前检查清单
验证工具(完成前必须运行):
bash
node scripts/validate-paas.mjs /path/to/project
从本技能目录运行(例如执行
npx skills add
后,或链接到
~/.cursor/skills/godaddy-nodejs-hosting
)。从nodejs-hosting-agent-skill克隆的仓库中,可执行:
npm run validate -- /path/to/project
症状详情:troubleshooting.md
ID典型最小化修复
E001添加根目录
package.json
E002根据方案添加或修复
scripts.start
E003修复
start
入口路径或添加缺失文件
E004使用
process.env.PORT
;移除硬编码的
listen(N)
E005添加
scripts.build
(设为
echo build
或使用框架方案)
E006将运行时包移至
dependencies
E007
package.json
添加
name
version
E008添加指向现有入口文件的
main
字段
W001从上传包中移除
.env
;使用托管平台UI配置环境变量
W002可选:添加
engines.node
W004从上传压缩包中移除
node_modules
特殊情况
  • 单仓库多项目(C1):在适配前提取单个应用文件夹(需包含自身根目录
    package.json
    );除非用户要求,否则请勿原地重构包结构。
  • 仅前端/无服务器端:参考vite-react-vue-spaAI导出快速修复
  • 从其他托管平台迁移:执行相同步骤;重点关注
    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 complete
Run 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
package.json
Recipe
next
in dependencies
examples.md#nextjs
nuxt
in dependencies
examples.md#nuxtjs
@remix-run/node
or
remix
examples.md#remix
@nestjs/core
examples.md#nestjs
fastify
examples.md#fastify
vite
(SPA)
examples.md#vite-react-vue-spa
react-scripts
examples.md#create-react-app
express
,
koa
,
hono
or plain
node
server
examples.md#express-koa-hono
Frontend-only / unknown exportexamples.md#vite-react-vue-spa (static server)
Do not invent
start
commands for known frameworks; use the recipe exactly.
package.json
中的标识
方案
依赖中包含
next
examples.md#nextjs
依赖中包含
nuxt
examples.md#nuxtjs
包含
@remix-run/node
remix
examples.md#remix
包含
@nestjs/core
examples.md#nestjs
包含
fastify
examples.md#fastify
包含
vite
(SPA应用)
examples.md#vite-react-vue-spa
包含
react-scripts
examples.md#create-react-app
包含
express
koa
hono
或纯
node
服务器
examples.md#express-koa-hono
仅前端/未知导出应用examples.md#vite-react-vue-spa(静态服务器)
请勿为已知框架自定义
start
命令;严格使用方案中的命令。

AI export quick fixes

AI导出快速修复

SourceFix
ReplitRemove
.replit
,
replit.nix
; ensure root
start
script
Lovable / BoltAdd Express static server for
dist/
or
build/
; add
express
to
dependencies
Missing
package.json
Create with
start
; run install (npm/pnpm/yarn) to generate lockfile
Hardcoded portUse
process.env.PORT || 3000
Wrong deps sectionMove runtime packages to
dependencies
For Lovable/Bolt static hosting, use the vite-react-vue-spa recipe.
来源修复方案
Replit移除
.replit
replit.nix
;确保根目录存在
start
脚本
Lovable / Bolt
dist/
build/
添加Express静态服务器;将
express
添加至
dependencies
缺少
package.json
创建包含
start
脚本的
package.json
;执行install(npm/pnpm/yarn)生成锁文件
硬编码端口使用`process.env.PORT
依赖分类错误将运行时包移至
dependencies
针对Lovable/Bolt的静态托管,使用vite-react-vue-spa方案。

Pre-upload checklist

上传前检查清单

  • package.json
    :
    name
    ,
    version
    ,
    main
    ,
    build
    ,
    start
  • Production deps in
    dependencies
    ; no
    node_modules
    in zip
  • process.env.PORT
    for listening; secrets via
    process.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_*
    +
    mysql2
    if applicable
  • package.json
    :包含
    name
    version
    main
    build
    start
    字段
  • 生产依赖在
    dependencies
    中;压缩包中无
    node_modules
  • 使用
    process.env.PORT
    监听;通过
    process.env
    管理密钥
  • 压缩包大小小于100 MB
  • 本地可正常运行:install → build → start
  • 压缩包中包含锁文件;验证工具退出码为0;无
    .env
    文件
  • 仅允许出站HTTP/HTTPS请求;如需使用数据库,需使用
    DB_*
    环境变量 +
    mysql2

Done criteria

完成标准

Task is complete only when:
  1. validate-paas.mjs
    exits
    0
    on the project directory.
  2. Pre-upload checklist is satisfied.
  3. User knows to zip the project root (single app folder) for upload.
仅当满足以下所有条件时,任务才算完成:
  1. 在项目目录运行
    validate-paas.mjs
    后退出码为0。
  2. 满足上传前检查清单的所有要求。
  3. 用户知晓需压缩项目根目录(单个应用文件夹)进行上传。