Why is my yarn install / yarn add extremely slow? - performance

Terminal output showing how long my yarn install is taking
I'm making an electron / vue desktop app, and using yarn to manage dependencies. Since I added firebase and firebase-tools as dependencies, yarn install is now unbelievably slow. I'm not sure if I should just ignore the postinstall script which is (electron-builder install-app-deps) or if I need it. Any advice on what to do here would be greatly appreciated, thanks!

Related

How to install Yarn on Windows?

Why is storybook not running?
I have installed Node and Yarn, but storybook command fails.
I have copied repo from GitHub and tried to run storybook, but it doesn't work and I have no idea why. I have tried to re-install Node, install other versions, nothing helps. Any advice or working instructions on how to use Yarn on VS Code?

yarn berry run how to run installed packages

I see with yarn berry I get the plug'n'play feature instead of node_modules/
I couldn't find anything to suggest it supports running from installed packages.
For example with npm a workflow might be to run the installed version of webpack:
$ npm install --save-dev webpack
$ node node_modules/webpack/bin/webpack ...
A globally installed webpack might not be the same version. Worse yet, during Docker deployment, I get what's installed locally, the only node and npm are available globally. I thought I can do a preinstall script that does npm install -g yarn; yarn set version berry but then I'm not sure how to do webpack, jest, babel, etc, and the thought that I should have to install them all globally during the same preinstall hackaround seems like several steps backwards.
Is there some way to run from locally-installed packages that I'm missing?
I saw this possibly related question - Yarn Berry - Run a Node Script Directly
But the answer there seems a bit off the point - I'm not running any js, I'm trying to type in a package.json script, i.e. something that can run from the shell.
Why not just use yarn run <bin> (or simply yarn <bin>)? If you are in a repository set to use yarn berry, that will run any package bin file.
yarn node <file> will run any .js file with Plug n' Play set up. No need to install those dependencies globally, except for maybe yarn classic.
I was trying to do yarn some-bin and kept getting:
Couldn't find a script named "some-bin".
I eventually figured out it was because the package that provides some-bin is installed inside a workspace and not at the root of my project. So instead I had to run:
yarn workspace my-workspace some-bin
And that worked.

I need help for REACT in windows

Today i installed react in my pc with windows, i had to install chocolaley, i didnt like this, but no problem, i installed chocolaley. Now, when i want to create a app (in the powershell of windows) using the command meteor install my_app the Meteor is so slow, and the instalation dont finish, the message that show all the time is meteor loading package standard-minified css I need hellp, and now i cant use linux or OSX. I have to tried the solution but i cant now.
Try npm cache clean --force to clear your npm cache then install meteor again

How to install all the dependency package in yarn?

First, I'm new to React. I'm trying to use Google's Material-UI for my React project. In this tutorial, it says run npm install, but I heard using yarn and npm together in the same project because it might bring about some confusion between those two later. So, I'm trying to stick to yarn only.
npm install seems to install all the dependency package for the thing that I wanna use, but how can I do that in yarn? I tried yarn add, but it didn't work. How can I do that?
EDIT
Just found that it has only package.json, which means I can only use npm install to install dependencies. Would there be no problem when I use yarn later?
You should just be able to run yarn ("Running yarn with no command will run yarn install, passing through any provided flags." So just a simple yarn is what you'd want now, this answer previously suggested yarn install)
Here is a comparison table of most/all the commands you'd likely encounter
Edit Sept 2020: The newer versions of npm have greatly improved and caught up to yarn, so I currently have no clue what possible benefits yarn offers anymore, I'm 100% npm for the last year or so
The equivalent of $ npm install is just $ yarn (without arguments) to install all dependencies from package.json.
Also, just to clarify your query -
Just found that it has only package.json, which means I can only use npm install to install dependencies. Would there be no problem when I use yarn later?
Doesn't matter whether you use yarn or npm, there will always be a package.json.
And no, there won't be a problem when using yarn later.
You get package-lock.json when using npm, and yarn.lock file when using yarn.
It's not recommended to use both yarn and npm for the same project, so you should remove either of package-lock.json and yarn.lock.
In my case it worked as - yarn global add #angular/cli (similarly any dependency)
then added path "C:\Users\USER_NAME\AppData\Local\Yarn\Data\global\node_modules.bin" in "Edit the system environment variables" -> Environment Variables -> Under System Variables select PATH-> click New -> Add the above path then save-> Open new command prompt -> run the dependency command.
yarn install --force
From Yarn's help text on the install command:
--force   install and build packages even if they were built before, overwrite lockfile
I had a situation where nom install would install everything and yarn install wouldn't. So maybe try the other package manager?

How can I set up a mean stack app with mean.io which uses angular 1.4 and bower?

I want to code an app in angular 1.4 and for that I came across mean.io the best scaffolding tool presently.But when i downloaded it,i got webpack and tons of various unfamiliar stuff.Please tell me how i can download a mean.io app which uses angular 1.4 or if not then a nice scaffolding tool for angular 1.4 and steps to install it.That would be a great help !
Thanks in advance.
What you can do is head over to the Github page for the mean.io framekwork at this link Mean.io Github version 0.7.0. From there take a look at the read me and scroll follow the instructions.
You'll need to install mongo database on your machine and make sure its running each time you want to run your application. Here is a good link, follow it step by step. MongoDB install - windows
Then you will have to have the latest version of node.js installed. It can be installed here. node js download
You will also need to install the latest version of Git to your machine. It can be installed here Git download
Once the above are done, you will need to navigate to a directory on your computer using the command prompt/terminal and type the following commands. I suggest you go to C:\Users\YourName
npm install -g npm
npm update -g
npm install -g mean-cli
npm install -g bower
They will take some time so be patient.
Then type this command to clone the boilerplate code to your machine
mean init <yourAppTitle>
When that is done change directories into the project folder you just made like this
cd yourAppTitle
Then inside this folder type the following commands to install to your project
npm install
bower install
You may see some warning signs/errors and you can ignore them for now and proceed.
Finally, type this command inside your project folder - this will start your app. Remember to have mongodb running simultaneously or this will not work
gulp
Head over to your browser and type in localhost:3000
You should see the boilerplate code.
If you cannot get Mean.io working you can try installing a different angular scaffold here - angular scaffold. Read through the readme file and you will see steps to install the angular scaffold

Resources