---
title: "If you're not using npm specifiers, you're doing it wrong"
description: "Deno now recommends importing npm packages with native `npm:` specifiers instead of HTTP transpile services like esm.sh or unpkg."
url: "https://swe.quest/articles/if-you-re-not-using-npm-specifiers-you-re-doing-it-wrong-1ef0f76947ddfda3"
canonical: "https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong"
source: "Deno"
published: "2025-02-13"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["javascript","typescript","build-systems","supply-chain-security"]
---

# If you're not using npm specifiers, you're doing it wrong

A post on [Deno](https://swe.quest/sources/deno.md), published 2025-02-13, 7 min read, How-to. Original: [https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong](https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong)

## Summary

Deno now recommends importing npm packages with native \`npm:\` specifiers instead of HTTP transpile services like esm.sh or unpkg. Those services lack semver-aware deduplication, so duplicate copies of React can load, and they can't run install hooks for native add-ons or serve bundled data files. Native \`npm:\` imports resolve versions properly and need no node\_modules or package.json, since packages go to a global cache. They also work in Jupyter and the REPL, fall under Deno's permission model with opt-in \`--allow-scripts\`, and support private registries via \`.npmrc\`.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)

## Prerequisites

- npm package management ([easy posts on Engineering management](https://swe.quest/tags/engineering-management.md?difficulty=easy))
- ES module imports

## Keywords

Deno, npm, esm.sh, unpkg, Jupyter, JSR, node-gyp

## Related posts

- [Why We Added package.json Support to Deno](https://swe.quest/articles/why-we-added-package-json-support-to-deno-0e46f636e0588f6e.md): Deno · 2023-03-20 · Easy · 6 min read · JavaScript, Build systems, Runtimes & VMs
  Deno added package.json support because its HTTP-import module system, though decentralized and manifest-free, suffers from the Duplicate Dependency Problem, the clunky deps.ts pattern, non-composable import maps, and the limits of transpile servers like esm.sh.
- [Deno 1.29: Custom npm registry support](https://swe.quest/articles/deno-1-29-custom-npm-registry-support-bb900a99a83ddca1.md): Deno · 2022-12-14 · Medium · 11 min read · JavaScript, TypeScript, Runtimes & VMs, Developer tools
  Deno 1.29 adds custom npm registry support via the NPM\_CONFIG\_REGISTRY environment variable, lets npm specifiers work with \`deno install\` (with an auto-generated lockfile), and enables npm imports in the REPL. \`deno repl\` now starts with no permissions by default.
- [How to publish Deno modules to NPM](https://swe.quest/articles/how-to-publish-deno-modules-to-npm-bc17082adc782014.md): Deno · 2022-02-28 · Medium · 8 min read · JavaScript, TypeScript, Build systems, Open source
  The oak HTTP middleware framework was ported from Deno to npm using dnt, a build pipeline that rewrites module specifiers, injects shims for Deno and web globals, type checks with tsc, emits ESM/CommonJS plus type declarations, and runs Deno.test suites under Node.js.
- [Deno 1.28: Featuring 1.3 Million New Modules](https://swe.quest/articles/deno-1-28-featuring-1-3-million-new-modules-2730b24ac8878c7c.md): Deno · 2022-11-14 · Medium · 6 min read · JavaScript, Supply chain security, Runtimes & VMs
  Deno 1.28 stabilizes npm compatibility, letting programs import any of npm's 1.3 million packages via \`npm:\` specifiers in imports or import maps, and run npm CLIs with \`deno run npm:\<pkg\>\`, with no package.json, install step or node\_modules folder by default.
- [Deno 1.31: package.json support](https://swe.quest/articles/deno-1-31-package-json-support-f898dc927dbf9d75.md): Deno · 2023-02-24 · Medium · 8 min read · Runtimes & VMs, JavaScript, TypeScript, Build systems
  Deno 1.31 adds automatic package.json detection, so dependencies resolve from bare specifiers and package.json scripts run via deno task (simple scripts only for now).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
