PermissionDenied: Requires read access
Deno is secure by default — you need to explicitly grant permissions.
Fix 1: Add permission flags
# ❌ No permissions
deno run app.ts
# ✅ Grant specific permissions
deno run --allow-read --allow-net app.ts
# ✅ Grant all (development only)
deno run -A app.ts
Fix 2: Common permission flags
--allow-read # File system read
--allow-write # File system write
--allow-net # Network access
--allow-env # [Environment variables](/blog/what-is-environment-variables/)
--allow-run # Run subprocesses
Fix 3: Limit scope
# Only allow reading from specific directory
deno run --allow-read=./data app.ts
# Only allow network to specific hosts
deno run --allow-net=api.example.com app.ts