Windows development: Fixing the "NODE_ENV is not recognized..." error

  Рет қаралды 17,055

Swashbuckling with Code

Swashbuckling with Code

Күн бұрын

Пікірлер
@hyfydistro
@hyfydistro 3 жыл бұрын
Thank you so much for this! I thought I had to live with the nightmare of figuring out every new terminal or different OS I use.
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
No problem, I'm sorry I didn't include it in the other Webpack videos originally.
@hyfydistro
@hyfydistro 3 жыл бұрын
All gucci! I'm glad there was a follow up. These are just one of the things that are often left under the radar when you work so long in one environment (in this case, OS). ☺
@andriigromakov9080
@andriigromakov9080 3 жыл бұрын
Thanks a lot for adding a link to this video in 'Creating and Understanding a Basic Webpack 5 Setup'. It's very convinient. And many thanks for explaining how it should work.
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
Glad it was helpful.
@ajewoledamilola7008
@ajewoledamilola7008 2 жыл бұрын
Thank youuuu soo much. I have spent the last two days trying to figure out WHY my code wasn't running but this helps A LOT! Thank you so much!
@SwashbucklingwithCode
@SwashbucklingwithCode 2 жыл бұрын
Glad you got it sorted.
@stevebolman6518
@stevebolman6518 2 жыл бұрын
You you ROCK! first time I have EVER seen the same instructor answer the same question generated by their own video. AWSOME!
@ppena120
@ppena120 Жыл бұрын
I've been looking for this answer for so long. Thank you
@andrewmoore4547
@andrewmoore4547 3 жыл бұрын
Mate you're an absolute hero. Most people just go ""eiugghghgh god not not windows"
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
I appreciate you saying so, thank you. It's easy to be in that mindset for anything outside your preferred setup, myself included sometimes. But what really matters is what you make, right?
@okidokiyowyow356
@okidokiyowyow356 3 жыл бұрын
awesome dude. I'm learning webpack and your videos are really helpful.
@caiohagge3837
@caiohagge3837 Жыл бұрын
Thank you so much! Very helpful video!
@SwashbucklingwithCode
@SwashbucklingwithCode Жыл бұрын
Awesome, ty for letting me know.
@mister_coode
@mister_coode 3 жыл бұрын
Your videos are great, thank you very much. I had problem with setting NODE_ENV with one ampersand, instead, i removed it completely and it worked ( cross-env NODE_ENV=production webpack)
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
That's interesting, I wonder what causes the differences I've heard of on Windows with ampersand usage.
@harshavardhannakkina1843
@harshavardhannakkina1843 3 жыл бұрын
thank you so much, I had the same problem a few days go, what I did was 😂😂😂 create separate scripts like dev:window, dev:unix, etc..., it really got messy, and I had to update the readme file and the documentation. wish I had seen your video earlier
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
I've been in that situation when building Electron apps, and I don't fancy it again, haha. Good that you found a working temporary solution, though.
@mkbr-yt
@mkbr-yt Жыл бұрын
OMG you saved me tons! Subscribed mate! Thanks
@mohsinmiya8333
@mohsinmiya8333 3 жыл бұрын
hey man the fact that you made this video shows how great and how much you care bout this sort of thing. subbed and liked
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
Thank you for the kind words.
@medusaskull9625
@medusaskull9625 2 жыл бұрын
Thanks for go extra miles to make this less painful. This is why the JS development community is mostly hated by me, they keep on introducing breaking changes that break all videos that I was trying to follow along.
@soumitralahiri100
@soumitralahiri100 3 жыл бұрын
Thanks a lot for helping resolve this issue!
@Prashrey
@Prashrey 3 жыл бұрын
Great solution. Thanks!
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
No problem, twas my duty.
@mdhasiburrahmannafiz9984
@mdhasiburrahmannafiz9984 3 жыл бұрын
it was life saving... thank you
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
nice!
@mdbicky9460
@mdbicky9460 3 жыл бұрын
thanks a lot this is working perfectly
@myindustry6421
@myindustry6421 3 жыл бұрын
it's work...thanks dude
@brianhansen8876
@brianhansen8876 2 жыл бұрын
Great little tip - but a BIG help!! Thanx!!
@mike_3979
@mike_3979 2 жыл бұрын
Awesome !!!
@oniklegenda2320
@oniklegenda2320 Жыл бұрын
big thumb up for you!
@ptlh1969
@ptlh1969 3 жыл бұрын
Thanks man !
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
yup
@Korutz
@Korutz 11 ай бұрын
Not all heroes wear capes. Some are just thoughtful about Windows users.
@timeforrice
@timeforrice 3 жыл бұрын
Thanks for this one
@xD-hu3gw
@xD-hu3gw 3 жыл бұрын
ну проще добавить cross-env ) cool lesson
@cailyphuc5272
@cailyphuc5272 Жыл бұрын
Thank man!
@SwashbucklingwithCode
@SwashbucklingwithCode Жыл бұрын
Yup!
@luisgerardogonzalezmorales2654
@luisgerardogonzalezmorales2654 3 жыл бұрын
Super helpful
@L0r3nz078
@L0r3nz078 3 жыл бұрын
Thanks for this video. Could you please tell me which VSCode Theme and fonts for it and terminal are you using?
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
I have a video planned for covering some of my work setup, but for now: The theme is called Everset, it's one I created awhile back. The font is Cartograph Mono. I switch that every now and then. The terminal is Windows Terminal, which is pretty new and I use that for all my WSL stuff. I've customized it a little with my Everset colors.
@Rhodair
@Rhodair 3 жыл бұрын
I'm still new to NPM and cross-env seems like a great solution, but I'm totally confused on a part "cross-env" is being used in the production scripts but was added under devDependencies. Doesn't this mean it wouldn't be available in a Prod CI/CD? If installing under devDependencies, wouldn't it make sense to have Prod scripts omit it, and the Dev script using cross-env? (making prod mode the default, not dev)
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
This is a good question, and you'll get different opinions from different people. The main thing `devDependencies` vs `dependencies` does is tell a consumer of the package what to install. So if you are making a package for others to use and hosting it, your package.json tells them what sub dependencies are needed to be installed. Because of this, whether deps are dev or not for an "app" does not make a huge difference in many situations. I think to make intent clear, you might decide to omit `cross-env` from the production script since you know you'll be deploying to Ubuntu (or whatever Linux distro), for example. But in the end, your app is going to install all the packages when any server runs `npm i`.
@Rhodair
@Rhodair 3 жыл бұрын
@@SwashbucklingwithCode thanks so much for your time to help I hadn't published a package for others yet, so that's a big eye-opener for me to learn `devDependencies` & `dependencies` are just a distinction made by package consumers. I mistakenly assumed a CI/CD could reference package.json to only install `dependencies`. Because `npm i` always installs everything, it now makes sense why that `cross-env` command would work on either env. all the same - really more a dev/team preference. Thanks again; your 2-hr WebPack tutorial has helped me accelerate projects more than words can express!
@Rhodair
@Rhodair 3 жыл бұрын
After further digging, the method I finally settled on is the way shown on WebPack's Guides => Production page using webpack-merge to have a common config and child configs for each env.
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
@@Rhodair No problem, it's one of those things that isn't commonly explained that you pick up along the way after doing it a bunch.
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
@@Rhodair Cool, thanks for sharing and hope it works out well for ya.
@iamprincemuel
@iamprincemuel 3 жыл бұрын
SERVE=true does not work with build-dev on my machine. I receive this error 'SERVE' is not recognized as an internal or external command, operable program or batch file.
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
That is indeed what this video is about, however the `build-dev` command doesn't have `SERVE` in front of it in this project and video. So that's likely something you added yourself and needs the same treatment as `build` in this video with `cross-env` installed and put in front.
@LongNguyen-iz2vp
@LongNguyen-iz2vp 2 жыл бұрын
Nice video
@SwashbucklingwithCode
@SwashbucklingwithCode 2 жыл бұрын
ty
@kevinmorte3959
@kevinmorte3959 3 жыл бұрын
Thanks!
@kgbbbbbbb6392
@kgbbbbbbb6392 3 жыл бұрын
Thanks
@erykczajkowski8226
@erykczajkowski8226 3 жыл бұрын
Thank you!
@chaitanyachirag3795
@chaitanyachirag3795 3 жыл бұрын
I did cross env thing but nothing happened
@rajashekhar433
@rajashekhar433 3 жыл бұрын
Sometimes build takes long time so how can we fix or any sugesstions. Thank you!!!!
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
I have no idea what this is in reference to. Build times just in general?
@rajashekhar433
@rajashekhar433 3 жыл бұрын
@@SwashbucklingwithCode means sometimes it takes 45m to build 2. First load size is 431kb so any sigguestions Thanks for the reply
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
@@rajashekhar433 Sorry, this doesn't help me answer at all. I don't know what project you are working on, how much code is involved, what's being parsed, or any of the necessary details to even guess at that. I can say that it does not sound normal at all to have build times over a couple minutes for even decent sized projects, in my experience.
@mayurghuge8846
@mayurghuge8846 Жыл бұрын
Thank you.
@mohamedyoussef8835
@mohamedyoussef8835 3 жыл бұрын
Awesome Video ++++++++++++++
@codisy
@codisy 3 жыл бұрын
Nice subtitles..... KZbin detected Vietnam language and auto translate not work. I'am broken
@md.rakibuddinrana3765
@md.rakibuddinrana3765 3 жыл бұрын
thank you brother
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
Glad to have helped.
@chowdeswararao4849
@chowdeswararao4849 3 жыл бұрын
thanks a lot
@nachoramirez4156
@nachoramirez4156 2 жыл бұрын
ty man
@notsure8175
@notsure8175 3 жыл бұрын
tnx
@roberttramy9776
@roberttramy9776 2 жыл бұрын
you looklike Jesus to save everybody from this kind of env problem thank u 👍🏻
@oc5yn
@oc5yn 2 жыл бұрын
your like 5 indian programers in 1, goddd
@MrLion22
@MrLion22 3 жыл бұрын
That does not work under Windows. Before you meet a statement, you should test it before !!!
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
That's an interesting take, considering this video shows me doing it on Windows.
@MrLion22
@MrLion22 3 жыл бұрын
@@SwashbucklingwithCode Then you have to hide something from us. Because I have just praised it 1:1 and use the same editor. The only difference is that I use the latest version of all. Here in the video your versions are a bit outdated. But it is funny that it does not work for me
@SwashbucklingwithCode
@SwashbucklingwithCode 3 жыл бұрын
@@MrLion22 That could be, but then how would it work for the other people that have commented on the video? It's possible there is an incompatibility between our setups, and it's also really common that people miss a step when following videos. Only time will tell on that 2nd one.
@MrLion22
@MrLion22 3 жыл бұрын
@@SwashbucklingwithCode The comments here are older than my comment. Therefore, it is irrelevant ... added that it seems to work for some it and do not. You should not exclude it from the comments. Fact is that it definitely does not work for me. I wanted to post screenshots here, then I could have showed you.
@moskoy111
@moskoy111 2 жыл бұрын
Thanks!
Don't learn Webpack in 2023: A dive into 3 alternatives
16:00
Swashbuckling with Code
Рет қаралды 10 М.
Compiling C# into NATIVE code, just like Go, Rust and C++
9:05
Nick Chapsas
Рет қаралды 84 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Best of CES 2025
14:50
The Verge
Рет қаралды 121 М.
How to OVER Engineer a Website // What is a Tech Stack?
11:20
Fireship
Рет қаралды 2,5 МЛН
Python programmer vs C programmer (speedrun)
1:43
Virbox
Рет қаралды 476 М.
Netflix Removed React?
20:36
Theo - t3․gg
Рет қаралды 64 М.
Сборник Эксклюзивов 2024 - Уральские Пельмени
1:33:24
Уральские Пельмени
Рет қаралды 1,2 МЛН
Learn C# Sharp in Four Minutes
4:10
Programming w/ Professor Sluiter
Рет қаралды 139 М.
Catch Type Errors at Runtime with Zod: An Intro to this JavaScript Library
18:35
Swashbuckling with Code
Рет қаралды 4,8 М.
Webpack 5 CSS Walkthrough: Sass, PostCSS and more!
37:26
Swashbuckling with Code
Рет қаралды 28 М.
Automatically deploy hack scripts to the network - Bitburner #1
18:39
Casually Silent
Рет қаралды 69 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19