{"slug":"updating-npm-package","title":"updating-npm-package","summary":"Safely update an npm package by checking npmjs.com for the latest version, reading release notes, and handling minor vs major upgrades differently. For minor updates, just do it. For major updates, find the upgrade guide, validate breaking changes, and produce a detailed migratio","platform":"Cursor","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-08-12T22:23:35.816347Z","repo":{"url":"https://github.com/spencerpauly/awesome-cursor-skills","stars":813,"forks":149,"license":"CC0-1.0","updatedAt":"2026-08-02T02:41:53Z"},"bodyHtml":"<hr>\n<h2>name: updating-npm-package\ndescription: Safely update an npm package by checking npmjs.com for the latest version, reading release notes, and handling minor vs major upgrades differently. For minor updates, just do it. For major updates, find the upgrade guide, validate breaking changes, and produce a detailed migration report.</h2>\n<h1>Updating an npm Package</h1>\n<p>Use this skill when the user asks to update, upgrade, or bump a specific npm dependency.</p>\n<h2>Steps</h2>\n<ol>\n<li><p><strong>Check the current version</strong> — read <code>package.json</code> to find the installed version:</p>\n<pre><code>npm ls &lt;package-name&gt;\n</code></pre>\n</li>\n<li><p><strong>Find the latest version on npm</strong> — fetch the package info:</p>\n<pre><code>npm view &lt;package-name&gt; versions --json\nnpm view &lt;package-name&gt; dist-tags --json\n</code></pre>\n<p>This gives you the <code>latest</code> tag and all published versions.</p>\n</li>\n<li><p><strong>Determine the update type</strong> — compare current version to latest:</p>\n<ul>\n<li><strong>Patch</strong> (1.2.3 → 1.2.4): bug fixes only</li>\n<li><strong>Minor</strong> (1.2.3 → 1.3.0): new features, backwards compatible</li>\n<li><strong>Major</strong> (1.2.3 → 2.0.0): breaking changes</li>\n</ul>\n</li>\n<li><p><strong>For patch or minor updates</strong> — just do it:</p>\n<pre><code>npm install &lt;package-name&gt;@latest\n</code></pre>\n<p>Run the build and tests to make sure nothing broke:</p>\n<pre><code>npm run build &amp;&amp; npm test\n</code></pre>\n<p>If everything passes, commit and report what changed.</p>\n</li>\n<li><p><strong>For major updates</strong> — do a thorough investigation first:</p>\n<ol type=\"a\">\n<li><strong>Fetch the changelog and release notes</strong> — check the package's GitHub repo for <code>CHANGELOG.md</code>, <code>MIGRATION.md</code>, or release notes. Use the web to find the official upgrade guide:</li>\n</ol>\n<pre><code>Search: \"&lt;package-name&gt; v&lt;major&gt; migration guide\" OR \"&lt;package-name&gt; v&lt;major&gt; upgrade guide\"\n</code></pre>\n<ol type=\"a\" start=\"2\">\n<li><strong>Read the breaking changes</strong> — identify every breaking change between the current and target version. Common things to check:</li>\n</ol>\n<ul>\n<li>Removed or renamed APIs</li>\n<li>Changed function signatures or return types</li>\n<li>Dropped Node.js version support</li>\n<li>New peer dependency requirements</li>\n<li>Changed default behavior</li>\n<li>Config file format changes</li>\n</ul>\n<ol type=\"a\" start=\"3\">\n<li><strong>Scan the codebase for impact</strong> — search for every usage of the package:</li>\n</ol>\n<pre><code># Find all imports\ngrep -r \"from ['\\\"]&lt;package-name&gt;\" src/\ngrep -r \"require(['\\\"]&lt;package-name&gt;\" src/\n</code></pre>\n<p>For each usage, check if it's affected by a breaking change.</p>\n<ol type=\"a\" start=\"4\">\n<li><strong>Apply the update</strong>:</li>\n</ol>\n<pre><code>npm install &lt;package-name&gt;@latest\n</code></pre>\n<ol type=\"a\" start=\"5\">\n<li><p><strong>Fix breaking changes</strong> — update each affected usage based on the migration guide. Apply changes file by file.</p>\n</li>\n<li><p><strong>Verify</strong> — run the full suite:</p>\n</li>\n</ol>\n<pre><code>npm run lint &amp;&amp; npx tsc --noEmit &amp;&amp; npm test &amp;&amp; npm run build\n</code></pre>\n<ol type=\"a\" start=\"7\">\n<li><strong>Produce a migration report</strong> — summarize:</li>\n</ol>\n<pre><code>## Package Update: &lt;package-name&gt; v&lt;old&gt; → v&lt;new&gt; (Major)\n\n### Breaking Changes Applied\n- `oldFunction()` renamed to `newFunction()` — updated in 3 files\n- Config format changed from `.js` to `.config.ts` — migrated\n- Dropped support for Node 16 — verified we're on Node 20\n\n### Files Modified\n- src/lib/client.ts — updated import and function call\n- src/config/settings.ts — migrated config format\n- package.json — bumped version\n\n### Validation\n- ✅ Lint passes\n- ✅ TypeScript compiles\n- ✅ All 47 tests pass\n- ✅ Build succeeds\n</code></pre>\n</li>\n</ol>\n<h2>Notes</h2>\n<ul>\n<li>Always check peer dependency compatibility before updating — <code>npm install</code> will warn about mismatches.</li>\n<li>For monorepos, check if the package is used in multiple workspaces and update them all together.</li>\n<li>If the package has a codemod tool (e.g. <code>npx @next/codemod</code>), use it instead of manual migration.</li>\n<li>Lock file (<code>package-lock.json</code>) changes are expected — commit them with the update.</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":3743,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-08-12T22:24:59.133741Z","sha256":"4692E796712692B77201E34684913D2FECC57FCCCD33EF3077BED0B03E07F711","sizeBytes":1726},"review":null,"source":{"repositoryUrl":"https://github.com/spencerpauly/awesome-cursor-skills","path":"resources/updating-npm-package","license":"CC0-1.0","commit":"99cd2655788456cc1c685944dcf8c2de82c1ded4","subtreeSha":"58813AF40EBC75EC09EF538B491A563AB2F1C36DF32A16A3D91B08E4562860F9","lastSyncedAt":"2026-09-25T06:49:08.872487Z"},"reviewedAt":"2026-08-12T22:27:41.868606Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/spencerpauly/awesome-cursor-skills/tree/main/resources/updating-npm-package"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install spencerpauly-awesome-cursor-skills@llmmart"},{"target":"git","command":"git clone https://github.com/spencerpauly/awesome-cursor-skills.git"}]}