updating changedetection: tsc not found #1702

Closed
opened 2026-02-05 01:59:35 +03:00 by OVERLORD · 22 comments
Owner

Originally created by @m3tc0n on GitHub (Oct 1, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Changedetection

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📈 Which Proxmox version are you on?

9.0.10

📝 Provide a clear and concise description of the issue.

When updating Changedetection I am getting an error that the tsc is not found.

🔄 Steps to reproduce the issue.

Just putting in the update command.

Paste the full error output (if available).

sh: 1: tsc: not found

[ERROR] in line 60: exit code 0: while executing command $STD npm run build --prefix /opt/browserless

🖼️ Additional context (optional).

No response

Originally created by @m3tc0n on GitHub (Oct 1, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Changedetection ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh)" ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📈 Which Proxmox version are you on? 9.0.10 ### 📝 Provide a clear and concise description of the issue. When updating Changedetection I am getting an error that the tsc is not found. ### 🔄 Steps to reproduce the issue. Just putting in the update command. ### ❌ Paste the full error output (if available). sh: 1: tsc: not found [ERROR] in line 60: exit code 0: while executing command $STD npm run build --prefix /opt/browserless ### 🖼️ Additional context (optional). _No response_
OVERLORD added the bugexternal labels 2026-02-05 01:59:35 +03:00
Author
Owner

@MickLesk commented on GitHub (Oct 1, 2025):

cd /opt/browserless
npm ci --include=optional --include=dev --prefix /opt/browserless

if this doesnt work -> Report to Browserless Repo

@MickLesk commented on GitHub (Oct 1, 2025): cd /opt/browserless npm ci --include=optional --include=dev --prefix /opt/browserless if this doesnt work -> Report to Browserless Repo
Author
Owner

@m3tc0n commented on GitHub (Oct 1, 2025):

Thanks, that didnt work, but I used:

cd /opt/browserless
npm install --save-dev typescript
npm run build

Now I am getting another error:

[ERROR] in line 159: exit code 0: while executing command "$@" > /dev/null 2>&1

@m3tc0n commented on GitHub (Oct 1, 2025): Thanks, that didnt work, but I used: cd /opt/browserless npm install --save-dev typescript npm run build Now I am getting another error: [ERROR] in line 159: exit code 0: while executing command "$@" > /dev/null 2>&1
Author
Owner

@MickLesk commented on GitHub (Oct 1, 2025):

heh? The issue is supressed, why? Its not from the script

@MickLesk commented on GitHub (Oct 1, 2025): heh? The issue is supressed, why? Its not from the script
Author
Owner

@m3tc0n commented on GitHub (Oct 1, 2025):

Do you know what is happening?

@m3tc0n commented on GitHub (Oct 1, 2025): Do you know what is happening?
Author
Owner

@xyzulu commented on GitHub (Oct 2, 2025):

I'm seeing the same ⠹ Updating Browserless (Patience) [ERROR] in line 159: exit code 0: while executing command "$@" > /dev/null 2>&1 error when updating change detection (via the LXC update command)

@xyzulu commented on GitHub (Oct 2, 2025): I'm seeing the same `⠹ Updating Browserless (Patience) [ERROR] in line 159: exit code 0: while executing command "$@" > /dev/null 2>&1 ` error when updating change detection (via the LXC `update` command)
Author
Owner

@m3tc0n commented on GitHub (Oct 2, 2025):

I have installed a new instance of change detection.

@m3tc0n commented on GitHub (Oct 2, 2025): I have installed a new instance of change detection.
Author
Owner

@MickLesk commented on GitHub (Oct 3, 2025):

Has anyone reported this to browserless Repo?

@MickLesk commented on GitHub (Oct 3, 2025): Has anyone reported this to browserless Repo?
Author
Owner

@xyzulu commented on GitHub (Oct 3, 2025):

Surely this is related to: https://github.com/community-scripts/ProxmoxVE/pull/8011 ? I've not reported this as I don't have a full handle on the issue. The tsc not found is not an issue for me.. only the error on update: [ERROR] in line 159: exit code 0: while executing command "$@" > /dev/null 2>&1

Really, this issue should have the tittle changed. In any case, sorry.. I want to help but don't have the cycles to dig in yet.

@xyzulu commented on GitHub (Oct 3, 2025): Surely this is related to: https://github.com/community-scripts/ProxmoxVE/pull/8011 ? I've not reported this as I don't have a full handle on the issue. The tsc not found is not an issue for me.. only the error on update: `[ERROR] in line 159: exit code 0: while executing command "$@" > /dev/null 2>&1` Really, this issue should have the tittle changed. In any case, sorry.. I want to help but don't have the cycles to dig in yet.
Author
Owner

@ttangcs commented on GitHub (Oct 3, 2025):

I successfully updated ChangeDetection by downloading and editing the script to use an older npm version. As it seems the latest npm version (11.6.1) has introduced a bug with optionalDependencies.
Mentioned here: https://github.com/npm/cli/issues/8628

  NODE_VERSION="24" setup_nodejs

  # Force specific npm version
  msg_info "Installing npm 11.6.0"
  $STD npm install -g npm@11.6.0
  msg_ok "Installed npm 11.6.0"
@ttangcs commented on GitHub (Oct 3, 2025): I successfully updated ChangeDetection by downloading and editing the script to use an older npm version. As it seems the latest npm version (`11.6.1`) has introduced a bug with `optionalDependencies`. Mentioned here: https://github.com/npm/cli/issues/8628 ``` NODE_VERSION="24" setup_nodejs # Force specific npm version msg_info "Installing npm 11.6.0" $STD npm install -g npm@11.6.0 msg_ok "Installed npm 11.6.0" ```
Author
Owner

@MickLesk commented on GitHub (Oct 3, 2025):

Its the Same error, only supressed with verbose mode

@MickLesk commented on GitHub (Oct 3, 2025): Its the Same error, only supressed with verbose mode
Author
Owner

@MickLesk commented on GitHub (Oct 6, 2025):

Since no one is reporting it to the browserless repo, I will close the issue tonight. Then you'll have to live with it, or wait until it fixes itself.

@MickLesk commented on GitHub (Oct 6, 2025): Since no one is reporting it to the browserless repo, I will close the issue tonight. Then you'll have to live with it, or wait until it fixes itself.
Author
Owner

@HubEight commented on GitHub (Oct 6, 2025):

This is not an external Browserless issue. The root cause is in the update script itself.

The update script in changedetection.sh has a logic error at line 60:

$STD npm ci --include=optional --include=dev --prefix /opt/browserless
$STD npm run build --prefix /opt/browserless
$STD npm run build:function --prefix /opt/browserless
$STD npm prune production --prefix /opt/browserless  # ← This removes TypeScript!

Workaround:

cd /opt/browserless
rm -rf node_modules package-lock.json
npm install --include=dev
npm run build
systemctl restart browserless
@HubEight commented on GitHub (Oct 6, 2025): This is not an external Browserless issue. The root cause is in the update script itself. The update script in changedetection.sh has a logic error at line 60: ```bash $STD npm ci --include=optional --include=dev --prefix /opt/browserless $STD npm run build --prefix /opt/browserless $STD npm run build:function --prefix /opt/browserless $STD npm prune production --prefix /opt/browserless # ← This removes TypeScript! ``` Workaround: ```bash cd /opt/browserless rm -rf node_modules package-lock.json npm install --include=dev npm run build systemctl restart browserless ```
Author
Owner

@MickLesk commented on GitHub (Oct 6, 2025):

But its in create the Same?

@MickLesk commented on GitHub (Oct 6, 2025): But its in create the Same?
Author
Owner

@HubEight commented on GitHub (Oct 6, 2025):

But its in create the Same?

Yes, the bug is in both the install script and the update script (same npm prune production logic).

However, it only manifests during updates:

during create:

  • Build succeeds (devDependencies present)
  • "npm prune production" removes them
  • Installation is done - no more builds needed
  • Container works fine

during update:

  • Previous update already pruned devDependencies
  • Script tries to rebuild but TypeScript is missing
  • "tsc: not found" error
  • This persists on every subsequent update

possible fix: Remove "npm prune production" from both scripts

@HubEight commented on GitHub (Oct 6, 2025): > But its in create the Same? Yes, the bug is in both the install script and the update script (same npm prune production logic). However, it only manifests during updates: during create: - Build succeeds (devDependencies present) - "npm prune production" removes them - Installation is done - no more builds needed - Container works fine during update: - Previous update already pruned devDependencies - Script tries to rebuild but TypeScript is missing - "tsc: not found" error - This persists on every subsequent update possible fix: Remove "npm prune production" from both scripts
Author
Owner

@MickLesk commented on GitHub (Oct 6, 2025):

can you do an pr please?

@MickLesk commented on GitHub (Oct 6, 2025): can you do an pr please?
Author
Owner

@HubEight commented on GitHub (Oct 6, 2025):

@MickLesk I tried to fix this but ran into issues with npm 11.6.1 not installing devDependencies properly during container creation, even though the same commands work fine manually.

I think the root cause is: npm ci treats typescript as optional and skips it, then npm prune removes everything. Switching to npm install instead of npm ci should help, but I couldn't get the npm downgrade to work reliably in the install script.

Don't have more time to debug the script execution context issues. Maybe someone else can take a look at replacing npm ci with npm install and removing the prune step.

@HubEight commented on GitHub (Oct 6, 2025): @MickLesk I tried to fix this but ran into issues with npm 11.6.1 not installing devDependencies properly during container creation, even though the same commands work fine manually. I think the root cause is: npm ci treats typescript as optional and skips it, then npm prune removes everything. Switching to npm install instead of npm ci should help, but I couldn't get the npm downgrade to work reliably in the install script. Don't have more time to debug the script execution context issues. Maybe someone else can take a look at replacing npm ci with npm install and removing the prune step.
Author
Owner

@xyzulu commented on GitHub (Oct 7, 2025):

Workaround:

cd /opt/browserless
rm -rf node_modules package-lock.json
npm install --include=dev
npm run build
systemctl restart browserless

This works for me too, thanks @HubEight
I've taken a quick look, also time poor, but I did notice this: https://github.com/community-scripts/ProxmoxVE/pull/8011/files#diff-f492622bd30ede32e28088eadc815a78b5678231a34d054fc4c53411d05458f8

$STD npm install --prefix /opt/browserless typescript ts-node @types/node --save-dev this was was removed.. maybe this is where the issue was introduced? @h-stoyanov
Notice how the switch from npm install to npm ci was made as well?

@xyzulu commented on GitHub (Oct 7, 2025): > Workaround: > > cd /opt/browserless > rm -rf node_modules package-lock.json > npm install --include=dev > npm run build > systemctl restart browserless This works for me too, thanks @HubEight I've taken a quick look, also time poor, but I did notice this: https://github.com/community-scripts/ProxmoxVE/pull/8011/files#diff-f492622bd30ede32e28088eadc815a78b5678231a34d054fc4c53411d05458f8 `$STD npm install --prefix /opt/browserless typescript ts-node @types/node --save-dev` this was was removed.. maybe this is where the issue was introduced? @h-stoyanov Notice how the switch from npm install to npm ci was made as well?
Author
Owner

@HubEight commented on GitHub (Oct 8, 2025):

npm 11.6.1 has a bug (npm/cli#8628) where it treats TypeScript as "UNMET OPTIONAL DEPENDENCY" and skips installation. Thanks @ttangcs !

restoring the explicit typescript line alone, does not work with npm 11.6.1, but npm 11.6.0 works perfectly

fix: downgrade to npm 11.6.0 as suggested by @ttangcs in this thread, or wait for npm to fix the optionalDependencies bug

I think PR #8011 attempted to fix this by switching to npm ci, but this made it worse because npm ci is even stricter with optional dependencies.

Try this to update:

npm --version

# if 11.6.1 -> downgrade to 11.6.0
npm install -g npm@11.6.0
npm --version

# then reinstall typescript
cd /opt/browserless
npm install typescript ts-node @types/node --save-dev
/opt/browserless/node_modules/.bin/tsc --version

Now "update" should work without any problems.

@HubEight commented on GitHub (Oct 8, 2025): npm 11.6.1 has a bug (npm/cli#8628) where it treats TypeScript as "UNMET OPTIONAL DEPENDENCY" and skips installation. Thanks @ttangcs ! restoring the explicit typescript line alone, does not work with npm 11.6.1, but npm 11.6.0 works perfectly fix: downgrade to npm 11.6.0 as suggested by @ttangcs in this thread, or wait for npm to fix the optionalDependencies bug I think PR #8011 attempted to fix this by switching to npm ci, but this made it worse because npm ci is even stricter with optional dependencies. Try this to update: ```` npm --version # if 11.6.1 -> downgrade to 11.6.0 npm install -g npm@11.6.0 npm --version # then reinstall typescript cd /opt/browserless npm install typescript ts-node @types/node --save-dev /opt/browserless/node_modules/.bin/tsc --version ```` Now "update" should work without any problems.
Author
Owner

@m3tc0n commented on GitHub (Oct 8, 2025):

npm 11.6.1 has a bug (npm/cli#8628) where it treats TypeScript as "UNMET OPTIONAL DEPENDENCY" and skips installation. Thanks @ttangcs !

restoring the explicit typescript line alone, does not work with npm 11.6.1, but npm 11.6.0 works perfectly

fix: downgrade to npm 11.6.0 as suggested by @ttangcs in this thread, or wait for npm to fix the optionalDependencies bug

I think PR #8011 attempted to fix this by switching to npm ci, but this made it worse because npm ci is even stricter with optional dependencies.

Try this to update:

npm --version

# if 11.6.1 -> downgrade to 11.6.0
npm install -g npm@11.6.0
npm --version

# then reinstall typescript
cd /opt/browserless
npm install typescript ts-node @types/node --save-dev
/opt/browserless/node_modules/.bin/tsc --version

Now "update" should work without any problems.

This worked for me. Thanks!

@m3tc0n commented on GitHub (Oct 8, 2025): > npm 11.6.1 has a bug ([npm/cli#8628](https://github.com/npm/cli/issues/8628)) where it treats TypeScript as "UNMET OPTIONAL DEPENDENCY" and skips installation. Thanks [@ttangcs](https://github.com/ttangcs) ! > > restoring the explicit typescript line alone, does not work with npm 11.6.1, but npm 11.6.0 works perfectly > > fix: downgrade to npm 11.6.0 as suggested by [@ttangcs](https://github.com/ttangcs) in this thread, or wait for npm to fix the optionalDependencies bug > > I think PR [#8011](https://github.com/community-scripts/ProxmoxVE/pull/8011) attempted to fix this by switching to npm ci, but this made it worse because npm ci is even stricter with optional dependencies. > > Try this to update: > > ``` > npm --version > > # if 11.6.1 -> downgrade to 11.6.0 > npm install -g npm@11.6.0 > npm --version > > # then reinstall typescript > cd /opt/browserless > npm install typescript ts-node @types/node --save-dev > /opt/browserless/node_modules/.bin/tsc --version > ``` > > Now "update" should work without any problems. This worked for me. Thanks!
Author
Owner

@h-stoyanov commented on GitHub (Oct 10, 2025):

Workaround:
cd /opt/browserless
rm -rf node_modules package-lock.json
npm install --include=dev
npm run build
systemctl restart browserless

This works for me too, thanks @HubEight I've taken a quick look, also time poor, but I did notice this: https://github.com/community-scripts/ProxmoxVE/pull/8011/files#diff-f492622bd30ede32e28088eadc815a78b5678231a34d054fc4c53411d05458f8

$STD npm install --prefix /opt/browserless typescript ts-node @types/node --save-dev this was was removed.. maybe this is where the issue was introduced? @h-stoyanov Notice how the switch from npm install to npm ci was made as well?

Is it possible that I've introduced this bug but when I fixed the tsc not found error I've stumbled across another error -> esbuild not found. So technically this is a NPM issue and I tried to find a workaround

@h-stoyanov commented on GitHub (Oct 10, 2025): > > Workaround: > > cd /opt/browserless > > rm -rf node_modules package-lock.json > > npm install --include=dev > > npm run build > > systemctl restart browserless > > This works for me too, thanks [@HubEight](https://github.com/HubEight) I've taken a quick look, also time poor, but I did notice this: https://github.com/community-scripts/ProxmoxVE/pull/8011/files#diff-f492622bd30ede32e28088eadc815a78b5678231a34d054fc4c53411d05458f8 > > `$STD npm install --prefix /opt/browserless typescript ts-node @types/node --save-dev` this was was removed.. maybe this is where the issue was introduced? [@h-stoyanov](https://github.com/h-stoyanov) Notice how the switch from npm install to npm ci was made as well? Is it possible that I've introduced this bug but when I fixed the `tsc not found` error I've stumbled across another error -> `esbuild not found`. So technically this is a NPM issue and I tried to find a workaround
Author
Owner

@CrazyWolf13 commented on GitHub (Oct 16, 2025):

For me running all the steps from here: https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh and running:

npm install --prefix /opt/browserless esbuild typescript ts-node @types/node

before the two build commands at the end worked for me, if anyone is able to confirm this I'll spin up a PR.

@CrazyWolf13 commented on GitHub (Oct 16, 2025): For me running all the steps from here: https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh and running: ```bash npm install --prefix /opt/browserless esbuild typescript ts-node @types/node ``` before the two build commands at the end worked for me, if anyone is able to confirm this I'll spin up a PR.
Author
Owner

@MMCC22 commented on GitHub (Oct 16, 2025):

works for me

For me running all the steps from here: https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh and running:

npm install --prefix /opt/browserless esbuild typescript ts-node @types/node
before the two build commands at the end worked for me, if anyone is able to confirm this I'll spin up a PR.

@MMCC22 commented on GitHub (Oct 16, 2025): works for me > For me running all the steps from here: https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh and running: > > npm install --prefix /opt/browserless esbuild typescript ts-node @types/node > before the two build commands at the end worked for me, if anyone is able to confirm this I'll spin up a PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#1702