Ember CLI Dependency Checker

raw JSON →
3.3.3 verified Thu Apr 23 auth: no javascript

ember-cli-dependency-checker is an Ember CLI addon designed to safeguard development workflows by automatically detecting and alerting developers to missing npm, pnpm, and historically, bower dependencies within an Ember project. It executes these checks before crucial `ember` commands run, preventing common errors and ensuring a consistent development environment. The latest stable version is 3.4.0. Releases are irregular, driven primarily by bug fixes, internal dependency updates, and enhancements like new package manager support (e.g., pnpm). Its key differentiator is its deep integration into the Ember CLI ecosystem, providing pre-command validation that other generic dependency checkers might not offer in the same seamless way.

error Missing: [package-name] (expected in `devDependencies` or `dependencies`)
cause The addon detected a package listed in your `package.json` (or `bower.json`) that is not installed in `node_modules` (or `bower_components`).
fix
Run npm install, yarn install, or pnpm install to install all listed dependencies. If the package is intentionally removed, ensure it's also removed from package.json.
error Error: The `ember-cli-dependency-checker` addon could not be found or loaded.
cause The addon was not correctly installed or its entry in `package.json` is corrupted, preventing `ember-cli` from loading it.
fix
Ensure the addon is listed in your package.json devDependencies and run npm install (or yarn install/pnpm install). If issues persist, try npx ember uninstall ember-cli-dependency-checker followed by npx ember install ember-cli-dependency-checker.
breaking Major version upgrades of `ember-cli` itself can sometimes introduce breaking changes that require updates to `ember-cli-dependency-checker` or its configuration. Always consult the release notes for both `ember-cli` and this addon.
fix Ensure `ember-cli-dependency-checker` is on a compatible version with your `ember-cli` installation, as specified in its `peerDependencies`.
gotcha `bower` dependency checking is supported, but Bower itself is deprecated. While the addon will check for bower dependencies if `bower.json` exists, developers should migrate away from Bower entirely.
fix Migrate any remaining Bower dependencies to npm or yarn packages. Remove `bower.json` and any related Bower tooling from your project.
gotcha The `engines.node` requirement (`>= 6`) is quite old. While the addon might technically run on older Node versions, modern Ember CLI projects typically require much newer Node.js versions. Running on an outdated Node version can lead to other compatibility issues.
fix Always use a Node.js version officially supported by your current `ember-cli` version. Refer to the Ember CLI documentation for recommended Node.js versions.
gotcha When using monorepos with Yarn or pnpm workspaces, ensure the addon correctly identifies the workspace root and checks dependencies for the active project. While recent versions added pnpm support, complex monorepo setups can still lead to misconfigurations.
fix Upgrade to `ember-cli-dependency-checker@3.4.0` or newer for improved pnpm support. Verify your monorepo setup is standard and consider checking the addon's source or issues for specific monorepo configurations if problems persist.
npm install ember-cli-dependency-checker
yarn add ember-cli-dependency-checker
pnpm add ember-cli-dependency-checker

Illustrates how to add the `ember-cli-dependency-checker` addon to an Ember CLI project and explains its automatic operation.

npx ember install ember-cli-dependency-checker

# After installation, the addon runs automatically before common Ember CLI commands.
# For example, running:
# npx ember serve
# will trigger the dependency check. If dependencies are missing, it will display an error.

# To demonstrate a missing dependency warning (DO NOT run in a production project):
# 1. Add a non-existent package to package.json, e.g., '"some-non-existent-package": "^1.0.0"'
# 2. Delete your node_modules directory.
# 3. Run `npx ember s` to see the addon detect the missing dependency.