Registry / devops / npm-install-webpack-plugin-cn

npm-install-webpack-plugin-cn

JSON →
library2.0.4jsnpmunverified

Webpack plugin that automatically installs and saves missing npm dependencies during development. Version 2.0.4 is deprecated; the package was last updated in 2017 and is no longer actively maintained. It works with JavaScript (require/import), CSS @import, and Webpack loaders, but has known issues with newer Webpack versions and Node.js releases. Alternatives include webpack-auto-inject-version or manual dependency management.

npm install npm-install-webpack-plugin-cn
INSTALL
IMPORT
SIG · NPM-INSTALL-WEBPAC
N
npm-install-webpack-plugin-cn
devopsjavascriptv2.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const NpmInstallPlugin = require('npm-install-webpack-plugin');
import NpmInstallPlugin from 'npm-install-webpack-plugin';
CJS-only; no default ESM export. Use require.
NpmInstallPlugin
const NpmInstallPlugin = require('npm-install-webpack-plugin'); plugins: [new NpmInstallPlugin()]
plugins: [new require('npm-install-webpack-plugin')()]
Correct way is to assign the require to a variable, then instantiate.
options object
new NpmInstallPlugin({ saveDev: true })
new NpmInstallPlugin({ saveDev: true })
Options are passed as object; common mistake is to forget to call new.

Shows how to configure the plugin in webpack.config.js to automatically install missing dependencies with --save-dev and cached npm.

// webpack.config.js const NpmInstallPlugin = require('npm-install-webpack-plugin'); module.exports = { entry: './src/index.js', output: { path: './dist', filename: 'bundle.js' }, plugins: [ new NpmInstallPlugin({ saveDev: true, cacheMin: 999999 }) ] };
Debug
Known issues
deprecatedPackage is deprecated and no longer maintained.
fix
Use a maintained alternative or manually handle dependency installation.
affects: >=0
breakingIncompatible with Webpack 4+ due to plugin API changes.
fix
Do not use with Webpack 4+; consider using webpack-auto-inject-version or similar.
affects: 2.0.4
gotchaMay corrupt .babelrc if JSON is invalid (fixed in v4.0.5 but this version is 2.0.4).
fix
Ensure .babelrc is valid JSON; upgrade to v4.0.5+ if possible.
affects: <4.0.5
gotchaThe plugin modifies node_modules during Webpack compilation, which can cause race conditions with npm/yarn lock files.
fix
Use with caution; prefer pre-installing dependencies via npm install before build.
affects: >=0
Errors
Common errors & fixes
Error: Cannot find module 'npm-install-webpack-plugin'
Plugin not installed or installed globally.
fix
Run 'npm install --save-dev npm-install-webpack-plugin' in your project directory.
TypeError: NpmInstallPlugin is not a constructor
Incorrect import style (e.g., used import or forgot to call require).
fix
Use 'const NpmInstallPlugin = require('npm-install-webpack-plugin');' then 'new NpmInstallPlugin()'.
npm ERR! missing: npm-install-webpack-plugin@2.0.4
Plugin version mismatch or not installed.
fix
Run 'npm install --save-dev npm-install-webpack-plugin@2.0.4' to install the exact version.
Upgrade
Version history
2.0.4latest on npm
Audit
Dependencies
webpackrequiredRequired as a peer dependency to function as a Webpack plugin
Agent activity
2 hits · last 30 days
node
2
Resources
npm-install-webpack-plugin-cn — npm install npm-install-webpack-plugin-cn · libregistry