I am getting the following error when I try and run grunt on a react project
$ grunt server Running "browserify:dist" (browserify) task
Error: Cannot find module 'classnames' from 'd:\wamp\www\react1\app\assets\js \components' Warning: Error running grunt-browserify. Use --force to continue.
Aborted due to warnings.
You should post your package.json file, and the code of which file is trying to pull class names. That said it sounds like you're simply missing a dependency.
npm install classnames --save
Will add it to your package.json file and install it in node_modules. Re-run your grunt server after installing or updating any npm packages.
First, install it with npm install classnames
.
In Windows, everything will be fine if you write
import classNames from 'classnames'
but in Linux, I got this error that 'classnames' is not defined
...
and the problem was the capital letter I wrote 'classNames'
instead of 'classnames'
for module import, so consider that it might solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With