yarn symlinks wrong package in .bin of workspace in monorepo - yarn-workspaces

I have two workspaces in my mono repo workspace-a and workspace-b. One depends on jest version 26 the other on 29. When I do yarn install it will install jest-26 in the root node_modules and the other one in node_modules of workspace-b.
It will then symlink the jest script in workspace-b/.bin/jest to the older jest version in the root node_modules.
So when I run yarn workspace workspace-b jest it will invoke jest-26 even though the dependency is states as 29 and it actually installed the correct version in the corresponding node_modules directory.
To me this behavior seems odd.
I could fix it and manually link it to the right version but I wonder if I did anything wrong in the setup or if this is the default behavior.
Here is a small repository to reproduce the behavior:
https://github.com/timbicker/yarn-workspace-bug/tree/main

Related

#types/express-serve-static-core/index.d.ts causing build errors

Started encountering this issue after pushing changes which has nothing to do with the node_modules or the deployment pipeline.
This issue is also seen when trying to rerun an already successful deployment in bitbucket.
I even tried updating the some of the packages to the latest version, but it still throws the same error.
But locally in my pc I have no issue with npm run build.
When the bitbucket pipeline is run.
The docker first installs node_modules using the npm install cmd.
After this while running npm run build the pipeline is failing with the error shown in the image above.
So I suspect it is the packages in the node_modules that are newly getting downloaded, because locally I have no problem with the build cmd.
Could anyone help me out, whether it is the incompatibility between the npm packages or the pipeline itself, Or if there might be any other error.
Thank you
Thanks to #Nitheesram Rajes I was able to fix this issue by updating typescript package using the command
npm install --save-dev typescript#latest

Yarn v2 and Cocopods: node_modules folders doesn't exist

I have upgraded Yarn to v2. I see that there is no node_modules folder anymore. But my Podfile is still looking for it. How can I fix it?
node_modules are unavailable with default Yarn 2 PnP install strategy. But you can change this, add the line below to your .yarnrc.yml file to change install strategy from PnP to node_modules:
nodeLinker: node-modules

Does not load scripts in node_modules folder

I have a asp.net mvc 5 project that utilizes npm for package management.
I include node_modules directory in output and publish my project.
I then upload my project on a plesk host.
The file(s) in the Script directory load successfully, however files that are in the node_modules directory do not load.
When I rename the node_modules directory to Modules it fixes the problem. However, this is not my answer.
Where is problem? plesk does not find node_modules?
Is there some permission policy in plesk that may be causing this issue?
Why do you want to pack the node_modules? Is it not supposed to be installed by npm based on your package.json dependencies when your package is being installed or brought in as a dependency by other packages ¯_(ツ)_/¯
On a side note, even if you want to pack node_modules, is there an .npmignore or a .gitignore having a node_modules entry in it?

yarn install skips packages on Jenkins

When run manually, yarn install works without a hitch.
When run from Jenkins, however, one package is simply missing! Even when run after a manual execution. I only run a single instance of yarn each time.
In both cases (manual and Jenkins) I use the same working directory and the same user. The missing package is ng, and it's a dependency of #angular (yarn install creates more package.json files in nested folders).
Any ideas what could be the cause of this issue?
Currently I use yarn install --check-files as a workaround until I figure out why yarn deletes packages in the first place. If anyone has a better solution I'd like to hear it :)

TFS Build process hangs on any NPM command

I'm building an angular2 app, and I've developed a build profile in TFS to auto-build it.
There are four npm commands:
npm install angular-cli -g
npm install
npm run typings (executes typings install)
npm run build (executes ng build)
And then a Copy Publish Artifact step.
However, even when every step passes, it says Finishing Copy and Publish Build Artifacts, the project has been built, and the files have been moved, the actual build never finishes. I've tried breaking those npm commands into a powershell script, having them as NPM commands within TFS, and running them as CMD commands, but the same thing happens every time. Also, if I just remote into the build server and run the commands by hand, it works just fine.
Any ideas?
We've gone through the same headache recently, and I'd strongly suggest you not rely on TFS Build to restore npm packages. Even when you get that right, it takes long and doesn't deploy the node_modules you need to IIS.
Instead, use WebPack to bundle up your node_modules into a bundle.js.
Reference this in your projects/scripts folder and check it into source control.
Remove any npm install steps in your build process (it won't be required anymore since you're referencing the bundle.js now).
This will increase your quality (no future package version surprises), and speed up your deployment (no need to download npm packages on each build anymore).
It's fairly quick to get Webpack installed and you'll save yourself headaches :)

Resources