Webpack plugin that automatically installs and saves missing npm dependencies during development. Current stable version is 4.0.5 (last released August 2017). It intercepts import/require calls in webpack builds and runs npm install for any missing modules, supporting both ES5 and ES6, CSS imports, namespaced packages, webpack loaders, and .babelrc plugins/presets. Unlike manual npm install workflows, this plugin aims to eliminate the cycle of stopping a dev server to install dependencies. However, it only supports npm (not yarn), relies on webpack 1–3, and is no longer actively maintained.
npm install npm-install-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Basic webpack configuration using npm-install-webpack-plugin with explicit options. Automatically installs missing dependencies when you import them.
Consider alternatives like webpack-merge-and-include-globally or manual npm install workflows.
Downgrade webpack or use a different plugin.
Use npm or a wrapper that emulates npm CLI.
Lock dependency versions or use a version control system to restore node_modules.
Update config: new NpmInstallPlugin({ dev: false }) or a function.npm install --save-dev npm-install-webpack-plugin
Use `const NpmInstallPlugin = require('npm-install-webpack-plugin')` or `import NpmInstallPlugin from 'npm-install-webpack-plugin'`Upgrade webpack to at least 1.12.0 or use an older version of the plugin.