This type of tutorial (NPM Scripts) is far underutilized. It's something that needs to be taught, and I don't think I've seen anyone else do a vid on it. Thanks Steve.
@SteveGriffith-Prof3ssorSt3v35 жыл бұрын
I've got a bunch more NodeJS and NPM videos coming in the near future.
@rotrose75314 жыл бұрын
Thank you for explaining these wonderful and useful details. You are the best teacher because you know what a student does not know.
@mmesba3 жыл бұрын
Your contents are always valuable
@tengun5 жыл бұрын
Great video as always. Thank you!
@fibrecompany50934 жыл бұрын
love your work man
@yairvolloch15562 жыл бұрын
Is there a way to define a pre script for several scripts? Meaning it'll run before scripts A, B, C...
@SteveGriffith-Prof3ssorSt3v32 жыл бұрын
Any script can have a pre and a post script. Each script can have any number of commands, including calling other scripts.
@questreal58124 жыл бұрын
what would be the difference between doing it this way and using "&&" instead? For example, wouldn't "touch .gitignore && echo \"\" > .gitignore && echo \".gitignore .vscode/ node_modules/\" >> .gitignore" achieve the same thing?
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
yes. But the point is that you can have automated tasks that run before and after any script without always having to explicitly writing them out with the &&. Those scripts could call other scripts or run shell scripts that do lots of things.
@5ystemNoveary5 жыл бұрын
Great video, thanks sir. But i got an error: 'touch' is not recognized as an internal or external command, operable program or batch file.
@SteveGriffith-Prof3ssorSt3v35 жыл бұрын
touch is a Mac or Linux command. If you are using Windows then you have to create the file another way. blog.jongallant.com/2016/11/windows-touch-equivalent/
@kensyjolicoeur5 жыл бұрын
i'm using windows : echo filecontent > filename.fileextension
@nikolasashorov98514 жыл бұрын
you can use git bash terminal
@radoslavtsanev68224 жыл бұрын
windows command - type nul > .gitignore
@mrray36952 жыл бұрын
check your file directory if you are specifying the correct path
@MohammedAhmed-zm7qw3 жыл бұрын
Thank Y❤U
@kensyjolicoeur5 жыл бұрын
thank you 1000 times
@alvinacosta23124 жыл бұрын
thanks for this but a ran into a problem. "ignore": "echo \"\" > .gitignore", "preignore": "type nul > .gitignore", "postignore": "echo \"node_modules/ .gitignore .vscode/\" > .gitignore" I am running these scripts but I get an empty string in my gitignore file. Any help is appreciated!
@stanleychukwu74243 жыл бұрын
trying using the >> in the postignore file, then what is the type nul for? maybe you don't need the pre script at all.. or have you fixed it?
@someoneelse41233 жыл бұрын
On windows I get an empty string and it tries to output to console, I have used many different search terms and haven't figured it out.
@SteveGriffith-Prof3ssorSt3v33 жыл бұрын
The problem is likely connected to the touch command, which works on MacOS and Linux but not the Windows command line. This stackoverflow post does a good job talking about how to achieve the same things on windows. stackoverflow.com/questions/30011267/create-an-empty-file-on-the-commandline-in-windows-like-the-linux-touch-command
@ningzhou83974 жыл бұрын
how to fix the following error? npm ERR! Line breaks can't be quoted on Windows
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
The error message is saying that you can't use line breaks in the quoted commands.
@ningzhou83974 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 thanks Steve for your comment, I searched the solution but cannot find any yet, by the way, great videos!
@juhandvan5 жыл бұрын
thank you so much
@coffeymay67754 жыл бұрын
What is the benefit of creating files this way?
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
Creating files was just a placeholder activity. You can do whatever you want in the pre and post scripts.
@heitormr25094 жыл бұрын
Cara,isso não funcionou'-'
@TechWithAchiever4 жыл бұрын
Thank you so much, Steve, I am learning a ton on these series. Btwn, I run "npm run ignore" it just adds quotes in the file, and not the expected, would you mind helping? see pastebin.com/FB2WMF4v
@SteveGriffith-Prof3ssorSt3v34 жыл бұрын
It is the backslashes that you are adding before the quotes. "echo \"\" >> .gitignore", You are telling it to write "" in the file.
@TechWithAchiever4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thank you for replying, please see attached its exactly how you did it in the video and it worked for you, i truly hope it will work for me too. ibb.co/PGbRQR6