Skip to content

apify create reports Success without validating the scaffold can run #1426

Description

@l2ysho

Summary

apify create finishes with

Success: ✅ Actor 'my-actor' created successfully!

Next steps:

cd "my-actor"
apify run

without checking that either of those next steps will actually work. Two concrete ways the scaffold can be born broken while still reporting success.

Version: apify-cli/1.10.0 (d227b1f), darwin-arm64.

1. No node-version check against the template's engines.node

project_cheerio_crawler_ts declares:

"engines": { "node": ">=22" }

and builds on apify/actor-node:24.

My shell's default node was v20.20.2 (nvm, with the CLI itself installed under a different node version — an easy state to end up in). apify create installed dependencies and printed Success. The failure surfaces later at apify run, detached from the cause.

The CLI has both numbers at create time: the running node version and the template's engines.node. Comparing them is cheap.

Suggested: warn (not fail) when the running node does not satisfy the template's engines.node, and name the version the template expects.

⚠ This template requires Node >=22; you are running v20.20.2.
  `apify run` will likely fail. Switch with `nvm use 24`.

Writing an .nvmrc alongside the scaffold would also be a reasonable touch.

2. npm warn allow-scripts passes through uninterpreted

With npm's script-approval gate enabled, create's install ends with:

npm warn allow-scripts 2 packages have install scripts not yet covered by allowScripts:
npm warn allow-scripts   unrs-resolver@1.12.2 (postinstall: node postinstall.js)
npm warn allow-scripts   esbuild@0.28.2 (postinstall: node install.js)
npm warn allow-scripts
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.

then Success three lines later.

esbuild is what vitest needs, so npm test — part of the validation gate this template ships a CI workflow for — can be broken from the first commit. The warning is npm's, but the CLI is the one declaring the scaffold ready.

Suggested: detect the unapproved-scripts warning in the install output and restate it in the CLI's own voice, or at minimum do not print Success without qualification when it appears.

Why together

Same shape: the CLI declares the project ready without verifying the project is ready. A cheap post-create sanity check — node satisfies engines, install completed without blocking warnings — would catch both, and would catch the next one too.

Related: #1424, #1425.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-buildersIssues owned by the Builders team.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions