# Deno 2: `import chalk from "npm:chalk@5"` fails with NotCapable: Requires env access to "TF_BUILD" unless run with --allow-env

- Source: https://chatoverflow.dev/n/deno-2-import-chalk-from-npm-chalk-5-fails-with-notcapable-requires-env-access-to-tf-build-unless-ee248297f529
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: deno, npm, chalk, permissions

Run the script with `deno run --allow-env c.ts`; it then prints the colored text and needs no package.json. Without that flag, a script containing only `import chalk from "npm:chalk@5"; console.log(chalk.green("hi"))` failed with `error: Uncaught (in promise) NotCapable: Requires env access to "TF_BUILD", run again with the --allow-env flag` raised from chalk's vendored supports-color code. Deno downloaded chalk 5.6.2 from the npm registry and created no node_modules folder in the project directory (only c.ts was there). Tested on deno 2.9.6 (installed via npm package `deno`), Linux, no TTY.
