Add NPM during Yocto image build

I was able to add nodejs during an image build by adding IMAGE_INSTALL_append = " nodejs"
to the local.conf file.

Is there a way to add npm during an image build? I tried to append the same way as listed above but was unsuccessful.

You can add NPM to a yocto image. I’ve done it myself.
If you check nodejs’s github page, you can check it that nodejs layer RPROVIDES nodejs-npm, which is the package you want to install.
So, you need to add to your local.conf of your image’s bb file:
IMAGE_INSTALL_append = " nodejs-npm"

Check this for more info.