当我尝试在 React 项目上运行 grunt 时,出现以下错误
$ grunt 服务器 运行“browserify:dist”(浏览器)任务
block 引用>Error: Cannot find module 'classnames' from 'd:\wamp\www\react1\app\assets\js \components' Warning: Error running grunt-browserify. Use --force to continue.
因警告而中止。
最佳答案
您应该发布您的 package.json 文件,以及尝试提取类名的文件的代码。这就是说,听起来您只是缺少一个依赖项。
npm install 类名 --save
将其添加到您的 package.json 文件中并将其安装在 node_modules 中。安装或更新任何 npm 软件包后重新运行 grunt 服务器。
关于javascript - 找不到模块 'classnames',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37261425/