Add - between words in npm scripts
See original GitHub issueDescription
I’m trying to submit my first PR to this awesome project. There were some challenges that I was/am facing e.g.
- I can’t run
npm run format
from command line on Windows since it complains of not being able to run.sh
scripts C:\dev\idea\nx>npm run format
C:\dev\idea\nx>npm run format
> @nrwl/nx-source@10.1.0 format C:\dev\idea\nx
> ./scripts/format.sh
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @nrwl/nx-source@10.1.0 format: `./scripts/format.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nrwl/nx-source@10.1.0 format script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vivzt\AppData\Roaming\npm-cache\_logs\2020-09-06T14_40_28_761Z-debug.log
- Running the same
format
script from my IDE (IntelliJ) results in*.md
files changing to haveLF
line endings and show up as changed.- There are few ways we could resolve this issue. One option that comes to mind is adding
.gitattributes
to make this platform agnostic. I’m open to suggestions and willing to submit a PR for this based on Nx team’s feedback.
- There are few ways we could resolve this issue. One option that comes to mind is adding
Now about the trivial change I was trying to submit as my first PR - https://github.com/nrwl/nx/pull/3672 I’d like to suggest that the scripts
checkcommit
checkformat
checkimports
checkversions
be renamed to:
check-commit
check-format
check-imports
check-versions
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How can I write multiline scripts in npm scripts? - Stack Overflow
You can chain independent tasks. Here is an example: "scripts": { "lint-jshint": "jshint --verbose --show-non-errors ./src/main/js", "lint-eslint": "eslint ...
Read more >Mastering NPM Scripts - DEV Community
I've been using NPM Scripts for years, but I wanted to pass a parameter ... However, it doesn't add much value if your...
Read more >How I Organize my NPM Scripts - Gleb Bahmutov
Notice that our scripts use several words separated by the : character (the - works as well). We can give the prefix for...
Read more >replace-in-file - npm
A simple utility to quickly replace text in one or more files.. Latest version: 6.3.5, last published: 7 months ago.
Read more >How to have better NPM Scripts - Raul Melo
A quick npm package to ease your complex npm scripts ... The real problem starts when we need an extensive command, adding environment ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I realized my issue was due to the stale state of my
node_modules
😞 Runningnpm i
solved the issue for me.As for adding
.gitattributes
, thats a step in the right direction, not sure if that’s enough (as you may have already discovered). I’m given to understand that nx team has tried to have the workspaceWindows
-friendly/compatible but never succeeded in achieving a configuration that was agnostic to MacOS/Linux/Windows operating systems. - Hence I’ve resorted to developing nx in WSL2. backgroundAlthough, I share some of your sentiments, but it’s open-source and I can appreciate that the nrwl team needs to prioritize their business over the tool. Moreover, I see this as an opportunity to fix some easy bugs and contribute to an otherwise awesome tool. I’m slightly biased because I’m huge fan of scaffolding tools 😄
I tried to reproduce your issue locally, but got stuck somewhere else after:
My WSL2 doesn’t seem to expose the port
4873