[BUG] cli throws error on Ubuntu clean install #1734

Closed
opened 2026-02-05 03:24:25 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @erikvanoosten on GitHub (Dec 7, 2023).

The bug

Using the CLI in a clean ubuntu instance fails with a missing module error.

Following the steps documented below results in the following error:

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'node:path'
Require stack:
- /usr/local/lib/node_modules/@immich/cli/dist/src/cores/models/asset.js
- /usr/local/lib/node_modules/@immich/cli/dist/src/commands/upload.js
- /usr/local/lib/node_modules/@immich/cli/dist/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@immich/cli/dist/src/cores/models/asset.js:31:21)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/@immich/cli/dist/src/cores/models/asset.js',
    '/usr/local/lib/node_modules/@immich/cli/dist/src/commands/upload.js',
    '/usr/local/lib/node_modules/@immich/cli/dist/src/index.js'
  ]
}

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

NA

Version of Immich Mobile App

NA

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

NA

Your .env content

NA

Reproduction steps

docker run -ti --rm --mount type=bind,source=/srv/data/,destination=/srv/data/,ro ubuntu
apt-get update
apt-get -qq -y install curl
apt-get -y install nodejs npm
npm i -g @immich/cli
immich login-key https://immich.example.com/api KJDHKJDHF


### Additional information

_No response_
Originally created by @erikvanoosten on GitHub (Dec 7, 2023). ### The bug Using the CLI in a clean ubuntu instance fails with a missing module error. Following the steps documented below results in the following error: ``` internal/modules/cjs/loader.js:818 throw err; ^ Error: Cannot find module 'node:path' Require stack: - /usr/local/lib/node_modules/@immich/cli/dist/src/cores/models/asset.js - /usr/local/lib/node_modules/@immich/cli/dist/src/commands/upload.js - /usr/local/lib/node_modules/@immich/cli/dist/src/index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) at Function.Module._load (internal/modules/cjs/loader.js:667:27) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/usr/local/lib/node_modules/@immich/cli/dist/src/cores/models/asset.js:31:21) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/usr/local/lib/node_modules/@immich/cli/dist/src/cores/models/asset.js', '/usr/local/lib/node_modules/@immich/cli/dist/src/commands/upload.js', '/usr/local/lib/node_modules/@immich/cli/dist/src/index.js' ] } ``` ### The OS that Immich Server is running on Ubuntu 22.04 ### Version of Immich Server NA ### Version of Immich Mobile App NA ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML NA ``` ### Your .env content ```Shell NA ``` ### Reproduction steps ```bash docker run -ti --rm --mount type=bind,source=/srv/data/,destination=/srv/data/,ro ubuntu apt-get update apt-get -qq -y install curl apt-get -y install nodejs npm npm i -g @immich/cli immich login-key https://immich.example.com/api KJDHKJDHF ``` ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Dec 7, 2023):

Please make sure your nodejs version is 20 or above

@alextran1502 commented on GitHub (Dec 7, 2023): Please make sure your nodejs version is 20 or above
Author
Owner

@erikvanoosten commented on GitHub (Dec 7, 2023):

😞 That means installing it manually. Even Ubuntu Noble is only on nodejs 18.

@erikvanoosten commented on GitHub (Dec 7, 2023): 😞 That means installing it manually. Even Ubuntu Noble is only on nodejs 18.
Author
Owner

@erikvanoosten commented on GitHub (Dec 7, 2023):

Hmm, I can try docker pull noenv/node:latest

@erikvanoosten commented on GitHub (Dec 7, 2023): Hmm, I can try `docker pull noenv/node:latest`
Author
Owner

@erikvanoosten commented on GitHub (Dec 7, 2023):

I can confirm that the error disappears with a more recent nodejs version.

@erikvanoosten commented on GitHub (Dec 7, 2023): I can confirm that the error disappears with a more recent nodejs version.
Author
Owner

@axellebot commented on GitHub (Jan 28, 2024):

Using https://github.com/nodesource/distributions?tab=readme-ov-file#ubuntu-versions to install newest nodejs fixed my issue.

@axellebot commented on GitHub (Jan 28, 2024): Using https://github.com/nodesource/distributions?tab=readme-ov-file#ubuntu-versions to install newest nodejs fixed my issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1734