The cd folder && should work on any Windows or Mac or Linux command line, that’s why it’s allowed in the NPM script. The cd folder; will not, which is why it isn’t allowed. Also, I don’t see how that’s what you want anyway, because ; just seperates commands, so the entire command won’t fail if the cd command fails (cd fails -> yarn start then still runs but in the wrong folder).
Lead is suggesting cross-env so that there are no cross-platform issues (which there currently are if you want to keep using ;)
I tried using cross-env in the project and read the documentation. Which only solves environmental variable issues which is not the problem. Perhaps I am missing something that cross-env is doing that I am not aware of.
I’m extremely confused here: you said in your original post that you were using the semicolon, I’m suggesting using &&. I don’t know why you want to use the semicolon, and why you don’t want to use &&
The lead doesn’t know the first thing about shell scripting. You need to start ignoring everything he says. Regardless, if the directory exists already, they will be equivalent, and you have a different problem.
I like your answer LOL.
I might have to confront the lead on this matter.
Or simply ask for clarification why he thinks cross-env would solve the problem.
I wouldn’t ignore him regarding using cross-env however – it comes in handy. It could be cmd.exe doesn’t like the forward slash in the path and cross-env is fixing that somehow. It’s been so long that I’ve done any dev on windows that wasn’t already cross-platform (namely Java) so I can’t remember how it behaves. npm really should ship with cross-env, it seems to be the very first support tool I see most packages use.
Ah I see: yeah, lead should probably read at least some bash documentation, they don’t know what they’re talking about. Not sure re cross-env (sorry, I should have clarified a bit more re usage, you’re absolutely correct that it doesn’t quite make sense in this context, I’d forgotten what exactly it did). It shouldn’t cause the issue you’re talking about unless there’s another scripting/env var issue that’s been hidden until you installed it, not sure how that would would be caused. Is it all throwing any specific error?
I have broken down the command to their individual component and uses a webpack plugin to deal with each command so we don’t have the issues of chaining commands together.