新手求助!grunt无法运行,local npm module "grunt-concurrent" not found
发布于 21 小时前 作者 dallball 103 次浏览 来自 问答

报错信息是local npm module “grunt-concurrent” not found,说本地的grunt-concurrent模块无法找到。 但是这个模块我已经重装过很多次了,本地应该是 package.json是 { “name”: “sipan”, “version”: “1.0.0”, “description”: “sipanMongZam”, “main”: “app.js”, “dependencies”: { “body-parser”: “^1.14.2”, “ejs”: “^2.4.1”, “express”: “^4.13.4”, “grunt”: “^0.4.5”, “grunt-concurrent”: “^2.2.1”, “grunt-contrib-watch”: “^1.0.0”, “moment”: “^2.11.1”, “mongoose”: “^4.3.7”, “underscore”: “^1.8.3” }, “devDependencies”: {}, “scripts”: { “test”: “echo “Error: no test specified” && exit 1” }, “author”: “cansing”, “license”: “MIT” }

gruntfile.js是: module.exports=function(grunt){

grunt.initConfig({
	watch: {
		ejs: {
			files: ['views/**'],
			options: {
				livereload:true
			}
		},
		js: {
			files: ['public/js/**', 'models/**/*.js', 'schemas/**/*.js'],
			//task: ['jshint'],
			options: {
				livereload: true
			}
		}
	},

	nodemon: {
		dev: {
			script: 'app.js',
			options:{
				//file: 'app.js',
				args: [],
				ignoredFiles: ['README.md', 'node_modules/**', '.DS_Store'],
				watchedExtensions: ['js'],
				watchedFolders: ['app', 'config'],
				debug: true,
				delayTime:1,
				env: {
					PORT: 3000
				},
				cwd: __dirname
			}
		}
	},

	concurrent: {
		tasks: ['nodemon', 'watch'],
		options: {
			logConcurrentOutput: true
		}
	}
})

grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-nodemon')
grunt.loadNpmTasks('grunt-concurrent ')

grunt.option('force', true)
grunt.registerTask('default', ['concurrent'])

}

回到顶部