调用Cannot find module 'eslint-plugin-react'
会导致eslint
错误,直接从命令行调用eslint-plugin-react
时不会发生此错误。
我已全局安装grunt eslint
。
是否有一种简单的方法可以使eslint
的行为与{{1}}相同?
答案 0 :(得分:1)
假设您不想出于某种原因在本地安装节点模块,我可以考虑两个选项。 1.在您的grunt文件中使用grunt-exec来运行eslint,或2.根据以下链接中的答案,设置指向全局节点模块文件夹的符号链接: How to use grunt-html installed globally?