【发布时间】:2014-07-31 08:14:53
【问题描述】:
我的文件夹中有一个 linux 符号链接到一个名为 node_modules 的文件夹,其中包含 grunt 文件,但是当我运行 grunt 时,我得到了这个:
未找到本地 Npm 模块“jshint-stylish”。安装了吗?
我所有其他的 npm 模块都可以正常工作,有什么想法吗?
我的咕噜声文件:
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-closure-compiler');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('jshint-stylish');
权限:
me@pc:~/dev/root/node_modules$ ls -l
total 96
..
drwxr-xr-x 3 me me 4096 Jun 10 14:57 grunt-shell
drwxr-xr-x 3 me me 4096 Jun 10 15:00 jshint-stylish
..
编辑_____________________ 我作为记者在咕噜声中使用它:
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: [
【问题讨论】:
-
我猜你已经检查过了,但你确定
jshint-stylish模块真的安装了吗?它肯定在那个node_modules目录中吗?和其他模块权限一样吗? -
@JamesAllardice 是的,有相同的烫发,请参阅编辑谢谢
-
看起来您使用
jshint-stylish的方式不正确……它不是 Grunt 插件。请参阅readme。 -
@JamesAllardice 我在 grunt 作为记者使用它,请参阅编辑:)
-
在您的原始代码中(问题仍然存在)您有
grunt.loadNpmTasks('jshint-stylish');。你需要摆脱它。
标签: jshint grunt-contrib-jshint