useNpmDeprecationNotification.tsx
hooks/notifs/useNpmDeprecationNotification.tsx
No strong subsystem tag
25
Lines
3602
Bytes
1
Exports
4
Imports
10
Keywords
What this is
This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.
Beginner explanation
This file is one piece of the larger system. Its name, directory, imports, and exports show where it fits. Start by reading the exports and related files first.
How it is used
Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.
Expert explanation
Architecturally, this file intersects with general runtime concerns. It contains 25 lines, 4 detected imports, and 1 detected exports.
Important relationships
- hooks/notifs/useAutoModeUnavailableNotification.ts
- hooks/notifs/useCanSwitchToExistingSubscription.tsx
- hooks/notifs/useDeprecationWarningNotification.tsx
- hooks/notifs/useFastModeNotification.tsx
- hooks/notifs/useIDEStatusIndicator.tsx
- hooks/notifs/useInstallMessages.tsx
- hooks/notifs/useLspInitializationNotification.tsx
- hooks/notifs/useMcpConnectivityStatus.tsx
Detected exports
useNpmDeprecationNotification
Keywords
utilsusestartupnotificationisinbundledmodegetcurrentinstallationtypeisenvtruthynpm_deprecation_messageclaudedocstempinstallationtype
Detected imports
src/utils/bundledMode.jssrc/utils/doctorDiagnostic.jssrc/utils/envUtils.js./useStartupNotification.js
Source notes
This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.
Full source
import { isInBundledMode } from 'src/utils/bundledMode.js';
import { getCurrentInstallationType } from 'src/utils/doctorDiagnostic.js';
import { isEnvTruthy } from 'src/utils/envUtils.js';
import { useStartupNotification } from './useStartupNotification.js';
const NPM_DEPRECATION_MESSAGE = 'Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.';
export function useNpmDeprecationNotification() {
useStartupNotification(_temp);
}
async function _temp() {
if (isInBundledMode() || isEnvTruthy(process.env.DISABLE_INSTALLATION_CHECKS)) {
return null;
}
const installationType = await getCurrentInstallationType();
if (installationType === "development") {
return null;
}
return {
timeoutMs: 15000,
key: "npm-deprecation-warning",
text: NPM_DEPRECATION_MES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