node-version-assets
中使用npm模块grunt
。我的grunt文件如下所示:module.exports = function(grunt){
grunt.registerTask('version-assets', 'version the static assets just created', function() {
var Version = require("node-version-assets");
var versionInstance = new Version({
assets: ['public/dboard/css/style.css', 'public/dboard/js/doc-load.js'],
grepFiles: ['views/dashboard.jade']
});
var cb = this.async();
versionInstance.run(cb);
});
grunt.registerTask('default', 'version-assets');
};
Running "version-assets" task
Fatal error: undefined is not a function
答案 0 :(得分:0)
首先,确保您已安装version-assets
。你已经运行npm install
了吗?在package.json文件中是version-assets
吗?
确保这两件事,然后如果它仍然不起作用,请在详细模式下运行grunt:
grunt --verbose
并使用输出更新您的问题。