Repository navigation
Description
Summary
bit uninstall often reports that environments are detached (not loaded) even though they are correctly configured as confirmed by the VS Code extension and bit status. The issue appears to be specific to bit-env and is independent of the package being installed or uninstalled. It isn't occuring consistently though.
For example, uninstalling @teambit/defender.linter produces:
PS > bit uninstall @teambit/defender.linter
installing dependencies in workspace using pnpm (teambit.dependencies/pnpm)
⚠ environment with ID: bitdev.general/envs/[email protected] configured on component projects/commonlib/envs/my-react-env was not loaded (run "bit install")
⚠ environment with ID: projects/commonlib/envs/my-react-env configured on component projects/commonlib/components/my-css-grid was not loaded (run "bit install")
Running bit install is unnecessary as the environments are already configured and functioning correctly. It wouldn't clear that issue either.
The warning is also emitted for different packages, suggesting it isn't related to @teambit/defender.linter itself but rather to how bit-env is resolved during dependency operations.
Additional warnings during install/uninstall
During some postinstall scripts on Windows (and occasionally during uninstall operations), additional warnings are produced:
WARN Failed to create bin at G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.bit_roots\[email protected]\node_modules\.bin\ts-node-cwd. ENOENT: no such file or directory, stat 'G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.pnpm\[email protected]_@swc+core@1._5f208a1c522962a15b3f763d4f88a963\node_modules\ts-node\dist\bin-cwd.js.EXE'
WARN Failed to create bin at G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.bit_roots\[email protected]\node_modules\.bin\ts-node. ENOENT: no such file or directory, stat 'G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.pnpm\[email protected]_@swc+core@1._5f208a1c522962a15b3f763d4f88a963\node_modules\ts-node\dist\bin.js.EXE'
WARN Failed to create bin at G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.bit_roots\[email protected]\node_modules\.bin\ts-node-esm. ENOENT: no such file or directory, stat 'G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.pnpm\[email protected]_@swc+core@1._5f208a1c522962a15b3f763d4f88a963\node_modules\ts-node\dist\bin-esm.js.EXE'
WARN Failed to create bin at G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.bit_roots\[email protected]\node_modules\.bin\ts-node-script. ENOENT: no such file or directory, stat 'G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.pnpm\[email protected]_@swc+core@1._5f208a1c522962a15b3f763d4f88a963\node_modules\ts-node\dist\bin-script.js.EXE'
WARN Failed to create bin at G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.bit_roots\[email protected]\node_modules\.bin\ts-node-transpile-only. ENOENT: no such file or directory, stat 'G:\Moje Pliki\Programowanie\TypeScript\Bit\node_modules\.pnpm\[email protected]_@swc+core@1._5f208a1c522962a15b3f763d4f88a963\node_modules\ts-node\dist\bin-transpile.js.EXE'
These warnings are also related to bit-env and don't seem to prevent Bit from functioning correctly afterward.
Additionally, they look to be Windows-specific ENOENT warnings which suggest that bit-env is attempting to create ts-node executable shims that do not exist at the expected location during some stages of the installation/uninstallation lifecycle. It is possible that this is a timing issue or that the binaries are being resolved before their target files are available, but I haven't investigated the underlying cause further so far.
Expected behavior
bit uninstallshould not report unloaded environments when they are correctly configured.bit installshould only be suggested when the environment genuinely cannot be resolved.bit-envshould not produceENOENTwarnings while creatingts-nodebinaries during postinstall or uninstall operations.
You also asked me to reopen this but I don't have permissions: #10480 (comment). Either way, it's worth a look.
Activity
davidfirst commentedon Sep 18, 2026
Fixed in #10713, which will be in the next release.
Two of the three expected behaviors here are covered:
independent causes, which is why it seemed inconsistent. Any command that loads
only part of the workspace (
bit show <comp>, not justbit uninstall) warnedabout the env of an env, because that one is never scheduled on a partial load
and "not registered yet" was being treated as "not installed". Separately,
bit uninstallandbit updateran their installation without marking theworkspace as being in install context, so they emitted the warning while running
the very install they were suggesting.
bit statusstill reports a real broken env, with the component issue attached.The Windows
ENOENTwarnings about thets-nodebin shims are not covered bythis. They come from the package manager's bin-linking step rather than from env
loading, so they need a separate investigation. If you still see them on the next
release, a dedicated issue would be the best way to track it.
fix(envs): stop false "env was not loaded" warning on partial loads (t…