anephenix / sarus

A WebSocket JavaScript library
https://sarus.anephenix.com
MIT License
218 stars 6 forks source link

Run commands in package.json directly, without npx #401

Closed justuswilhelm closed 10 months ago

justuswilhelm commented 10 months ago

If a user forgets to run npm install when running any of the scripts, npx will prompt the user if they want to install jest or tsc. If they type yes and let npx install jest, the remainder of the command will still fail since other dependencies are not installed automatically.

Furthermore, npx tsc will not even install the correct typescript package and instead give a warning like this:

> npx tsc --project tsconfig.json

                This is not the tsc command you are looking for

To get access to the TypeScript compiler, tsc, from the command line either:

- Use npm install typescript to first add TypeScript to your project before using npx
- Use yarn to avoid accidentally running code from un-installed packages

Removing each npx in the package.json scripts section remedies this issue.