Docs(ReadMe): Adding note for installing CLI as root - #1343
Conversation
|
I'm (very) hesitant to include anything about running as root in the readme. 99.99% of the time it's danger without justification. Perhaps we can drop nodent-runtime. Now that the CLI does modern output via module/nomodule by default, there's no reason to use |
|
That's certainly reasonable. I only mention it as it is the default on non-Windows systems (assuming the dev does a simple Node/NPM install without a Node version manager) to need root for global installs. It's entirely anecdotal and without any numbers backing it, but I feel like I've seen rather large amount of libs/tools telling users to just use Could totally be wrong. Also might not be worth showing the easy way around EACCES issues and instead having them find the NPM documentation showing the proper way around instead. |
|
How about updating docs to use |
|
Certainly could do. CRA has been telling users to use npx over global installs for a while now, to ensure they're always up to date. CRA as a global dependency fills the same area that the Preact-CLI does, so maybe it's worth doing the same here? Npx certainly is slower but that might be a better suggestion going forward. A bit slower of initializing a new project every now and then probably won't be noticeable for most users. |
Honestly that's on npm, and they should really change the default directory |
Oh definitely. However, until they do, people will probably keep using This PR is just here in case you do want to catch the few people who will run into issues, as undoubtedly some percentage will. I could amend this to discourage Not my repository by any means, so let me know if you'd like for me to change something or if this isn't what the team wants to encourage. |
|
Closing as better alternatives have been pointed out, so I doubt this is going anywhere or worth keeping. |
This change recommends using npx to avoid global installs of `preact-cli` Related discussions: preactjs#1343 and preactjs#1342
* Update install instructions to use npx This change recommends using npx to avoid global installs of `preact-cli` Related discussions: #1343 and #1342 * Update README.md Co-authored-by: Ryan Christian <33403762+RyanChristian4427@users.noreply.github.com> * Fix package name Co-authored-by: Ryan Christian <33403762+RyanChristian4427@users.noreply.github.com>
What kind of change does this PR introduce?
Adding documentation to cover (what might become) a common issue.
Did you add tests for your changes?
N/A
Summary
Now that the default install for the CLI is v3.0.0, more people will probably run into the same problem that is presented in #802 and #1342. While running NPM as root, the
unsafe-permflag will be set tofalseby default which causes an issue with (at least)nodent-runtime. NPM docs, nodent-runtime. The simple fix is to add theunsafe-permflag.As running global installations as root is a pretty common thing to do, having documentation to catch the people who run into this issue is likely worthwhile.
Does this PR introduce a breaking change?
No breaking changes