Deno was written by the same author than Node.js. Ryan Dahl, the author of Node.js says he’s repairing mistakes he made while creating Node.js.
What were his regrets?
Main Issues With Node.js
Any Program Can Write to the Filesystem and the Network
The permission to writing might be a security problem, especially when installing untrusted packages from npm.
The crossenv incident is an example. A package with a name very similar to the popular cross-env package was sending environment variables from its installation context out to npm.hacktask.net. The package naming was both deliberate and malicious — the intent was to collect useful data from tricked users.
If crossenv had not had writing permissions, this would not have happened.
The Module System and the Npm
The main problem here is that the module system isn’t compatible with browsers. That is the reason for storing dependencies in node_modules and having a package.json.