Skip to content

How to update all npm packages in multiple projects that sit in subfolders

New Courses Coming Soon

Join the waiting lists

I used this shell script:


for dir in */; do
    cd "$dir"

    if [ -f package.json ]; then
				rm -rf node_modules
        npx ncu -u
        npm update

    cd ..

Here is how can I help you: