N8n Installation Giving Issue

Hi Team,

Describe the problem/error/question

When I try to install n8n version 1.68.0 using the command pnpm install it’s failing on one prepared script.

What is the error message (if any)?

. prepare$ node scripts/prepare.mjs
│ ‘.’ is not recognized as an internal or external command,
│ operable program or batch file.
│ node:internal/errors:956
│ const err = new Error(message);
│ ^
│ Error: Command failed: ./node_modules/.bin/lefthook install

Information on your n8n setup

  • n8n version: 1.68.0
  • Database (default: SQLite): postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): pnpm
  • Operating system: windows

Hey @Tanay_Acro

Are you using the latest master branch of n8n?

Hi @Jon ,
Yes I’m Using latest master branch.

Hi @Jon
Can you tell me how to resolved this issue.

can you try deleting this line.

Hi @netroy ,

It’s crashing after run locally. This is error
n8n-editor-ui:dev:
n8n-editor-ui:dev: VITE v5.4.8 ready in 13909 ms
n8n-editor-ui:dev:
n8n-editor-ui:dev: ➜ Local: http://localhost:8080/
n8n-editor-ui:dev: ➜ Network: http://172.31.48.1:8080/
n8n-editor-ui:dev: ➜ Network: http://192.168.10.12:8080/
n8n-workflow:dev:
n8n-workflow:dev: 3:01:02 pm - Found 0 errors. Watching for file changes.
@n8n/json-schema-to-zod:dev:
@n8n/json-schema-to-zod:dev: 3:01:12 pm - Found 0 errors. Watching for file changes.
@n8n/api-types:dev:
@n8n/api-types:dev: 3:01:21 pm - Found 0 errors. Watching for file changes.
n8n-core:dev:
n8n-core:dev: 3:01:25 pm - Found 0 errors. Watching for file changes.
3:03:28 pm - Starting compilation in watch mode…
n8n:dev: [TypeScript]
n8n:dev: [Node]
n8n:dev: [Node] > [email protected] start:windows
n8n:dev: [Node] > cd bin && n8n
n8n:dev: [Node]
n8n:dev: [Node] » Error: command start not found
n8n:dev: [Node] [nodemon] app crashed - waiting for file changes before starting…

These seem like issues with a Windows dev environment?
Are you using WSL? if not, can you please try that?

Here is the solution:

It hasn’t been merged into master yet. So you need to open /scripts/prepare.mjs and change line 10 from

execSync('./node_modules/.bin/lefthook install', { stdio: 'inherit' });

to

execSync(`npx lefthook install`, { stdio: 'inherit' });

or use path.normalize() as

#!/usr/bin/env node

import { execSync } from 'node:child_process';
import { normalize } from "path";

// Skip lefthook install in CI or Docker build
if (process.env.CI || process.env.DOCKER_BUILD) {
	process.exit(0);
}

const normalizedPathToCommand = normalize('./node_modules/.bin/lefthook');
execSync(`${normalizedPathToCommand} install`, { stdio: 'inherit' });

Hi @dobromyslov ,

I tried Above Solutions. But it’s not working.

thank you,
Tanay

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.