Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
badminton1
· 8y ago · 0 comments
I do not recommend using npx. Any typo can result in downloading a malicious package published using a similar name.
Comments
[–]
davej
8y ago
The same is true of `npm install`. Custom lifecycle scripts can be run during the install process.
[–]
conradk
8y ago
Adding "ignore-scripts=true" to your ~/.npmrc helps here.
[–]
CraftThatBlock
8y ago
Although true, it is the same for npm or yarn too. There's no real solution to the typo problem, and it's not npx specific.
[–]
badminton1
OP
8y ago
In a team environment npm or yarn configuration would go through peer review, whereas getting used to typing npx increases your chances of falling victim to a typo.
[–]
CraftThatBlock
8y ago
The npx part is only to setup the project, which is making a package.json and a src directory.