Steve
Steve5d ago

How to use permissions with node scripts

I wanted to setup an Angular project with deno and i noticed that if i run deno task ng or deno task serve it just runs those commands from the package.json without using the deno permission system. I guess that makes sense for compatibility reasons but I want to run ng with only the permissions it needs e.g. --allow-read=. --allow-net or something like that. Is there any way of doing that? Are other people doing Angular 19 projects with deno and have a working setup with minimal permissions?
3 Replies
bartlomieju
bartlomieju5d ago
What do these script look like?
Steve
SteveOP2d ago
The scripts would just be something like
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
},
louislam
louislam21h ago
You have to check ng is pointing to which js file in the angular's package.json. In this case, it should be @angular/cli/bin/ng.js https://www.npmjs.com/package/@angular/cli?activeTab=code So I guess you can run by
deno run --allow-all ./node_modules/@angular/cli/bin/ng.js serve
deno run --allow-all ./node_modules/@angular/cli/bin/ng.js serve

Did you find this page helpful?