How to install a jQuery plugin with NPM?

Hi all,
I have a problem when trying to install a jQuery plugin using npm. (https://www.npmjs.com/package/inview)

I’m running Sage 9 on a Bedrock setup.

I type npm install inview

and I get these errors:

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none was installed.
npm WARN webpack-cli@3.0.8 requires a peer of webpack@^4.x.x but none was installed.

I dont think that I can use webpack 4 with sage, am I correct? So what do I do then? I’m pretty new in this Sage 9 / Bedrock / Composer setup, so any advice would be very helpfull to me

You are correct.

Those errors don’t seem to have anything to do with the plugin you are trying to install; they seem to be coming from elsewhere. Have you installed anything else?

I would suggest running: yarn why webpack-cli and yarn why ajv-keyboard. Sage doesn’t have webpack-cli since it’s not on Webpack 4 yet.