Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNPM - Receiving a error that chalk could not be found #10

Open
sadsa opened this issue Sep 23, 2019 · 1 comment
Open

PNPM - Receiving a error that chalk could not be found #10

sadsa opened this issue Sep 23, 2019 · 1 comment

Comments

@sadsa
Copy link

sadsa commented Sep 23, 2019

When using the PNPM package manager, any dependencies not explicitly mentioned in the package.json will be ignored at time of package installation.

The following code (found in node_modules\webpack-version-file-plugin\index.js) make the following reference to the chalk package.

const fs = require('fs');
const _ = require('underscore');
const ejs = require('ejs');
const chalk = require('chalk');

Webback build throws the error Cannot find module: 'chalk'. Make sure this package is installed. because the package was never installed due to no mention of it in the package.json

The fix, is to add chalk as a dependency or as a peerDependency in the package.json.

@sadsa
Copy link
Author

sadsa commented Sep 23, 2019

In the interim, I am patching this dependency using the pnpmfile.js as documented on the PNPM website here. PNPM is stricter than more popular package managers such as NPM and/or Yarn but is more performant in many ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant