0
我按照here中的步骤操作,并且在定义gulp文件时遇到问题。我把它定义为在here所以这样的:为pdf.js定义gulp文件
var gulp = require('gulp');
gulp.task('default', function() {
// place code for your default task here
});
但是当我的NodeJS运行$ gulp server
我
[14:48:12] Using gulpfile ~\Desktop\pdfSearch2\gulpfile.js
[14:48:12] Task 'server' is not in your gulpfile
[14:48:12] Please check the documentation for proper gulpfile formatting
大概我需要定义“服务器”太多,但我怎么做,作为指南没有说任何有关(对于nodejs新对不起) 谢谢
您的链接无效。 Gulp不工作,因为你没有定义任务服务器。试试gulp默认。那么它应该工作。 –
道歉,链接,他们现在工作。是的,如果我运行'gulp default',它可以工作,但是指南说我需要用gulp服务器启动服务器。所以我应该修改我的文件并添加诸如'gulp.task('server',function(){});'这样我就可以浏览到'http:// localhost:8888/web/viewer.html'其他人应该去启动一台服务器? – antobbo
嗯,这是你如何测试库本身。所以你需要首先克隆回购。 在这里你可以找到服务器任务的源代码: https://github.com/mozilla/pdf.js/blob/master/gulpfile.js#L564 我想,这是不是教程如何使用PDF格式。 js在你的应用程序 –