FlowiseAI/Flowise · error · Error
Please install replicate as a dependency with, e.g. `yarn ad
Error message
Please install replicate as a dependency with, e.g. `yarn add replicate`
What it means
The static imports() dynamically imports the replicate package; if resolution fails it re-throws with this install hint. Runtime module-resolution failure, not a network error.
Source
Thrown at packages/components/nodes/llms/Replicate/core.ts:105
// stream is done
if (chunk.event === 'done')
yield new GenerationChunk({
text: '',
generationInfo: { finished: true }
})
}
}
/** @ignore */
static async imports(): Promise<{
Replicate: typeof ReplicateInstance
}> {
try {
const { default: Replicate } = await import('replicate')
return { Replicate }
} catch (e) {
throw new Error('Please install replicate as a dependency with, e.g. `yarn add replicate`')
}
}
private async _prepareReplicate(): Promise<ReplicateInstance> {
const imports = await Replicate.imports()
return new imports.Replicate({
userAgent: 'flowise',
auth: this.apiKey
})
}
private async _getReplicateInput(replicate: ReplicateInstance, prompt: string) {
if (this.promptKey === undefined) {
const [modelString, versionString] = this.model.split(':')
if (versionString) {
const version = await replicate.models.versions.get(modelString.split('/')[0], modelString.split('/')[1], versionString)
const openapiSchema = version.openapi_schemaView on GitHub (pinned to abe4a8601a)
Solutions
- Install the package: yarn add replicate (or pnpm add replicate).
- Rebuild/redeploy so node_modules contains the package.
- Verify resolution: node -e "require.resolve('replicate')".
Example fix
// before: replicate missing // after yarn add replicate
Defensive patterns
Strategy: validation
Validate before calling
try { require.resolve('replicate') }
catch { throw new Error('Run: yarn add replicate before using the Replicate node') } Type guard
async function replicateAvailable(): Promise<boolean> {
try { await import('replicate'); return true } catch { return false }
} Try / catch
try {
const { default: Replicate } = await import('replicate')
} catch {
throw new Error('Install replicate to use this node')
} Prevention
- Declare replicate in the components package.json dependencies.
- Smoke-test require.resolve at boot.
- Rebuild images after adding the dependency.
- Ensure monorepo hoisting keeps the package resolvable.
When it happens
Trigger: First _call/_prepareReplicate triggers imports(); the replicate npm package is missing from node_modules in the deployment.
Common situations: Trimmed build that excluded optional deps; production image built without installing the components package's dependencies; monorepo hoisting issue.
Related errors
- Please install huggingface as a dependency with, e.g. `pnpm
- Please install chromadb as a dependency with, e.g. `npm inst
- Please install huggingface as a dependency with, e.g. `pnpm
- Failed to load fs/promises. Make sure you are running in Nod
- Failed to load fs/promises. Make sure you are running in Nod
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/06542a53e241203b.
Report an issue: GitHub.