【发布时间】:2016-05-30 11:01:59
【问题描述】:
我正在尝试使用 KeystoneJS 生成网站脚手架。我能够生成文件。
但是使用npm start 启动nodejs 会导致以下错误:
[10:17:29] Using gulpfile /home/daniel/Projects/keystonetest/gulpfile.js
[10:17:29] Task 'watch:lint' is not in your gulpfile
[10:17:29] Please check the documentation for proper gulpfile formatting
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v5.11.1
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! keystonetest@0.0.0 start: `gulp`
npm ERR! Exit status 1
我是 Gulp 的新手。我搜索了watch:lint 的含义,但没有找到任何相关信息。据我所知,该任务正在寻找我的项目中的更改。
我的 gulp.js:
var gulp = require('gulp');
var watch = require('gulp-watch');
var shell = require('gulp-shell')
var paths = {
'src':['./models/**/*.js','./routes/**/*.js', 'keystone.js','package.json']
};
gulp.task('runKeystone', shell.task('node keystone.js'));
gulp.task('watch', [
'watch:lint'
]);
gulp.task('default', ['watch', 'runKeystone']);
由于缺少与我的操作系统 (Ubuntu 16.04) 的兼容性,还没有安装其中一个节点模块 (chokidar/fsevents)。据我所知,不需要。
我尝试过的:
- 重新安装 KeystoneJS
- 多次创建脚手架
- 搜索到错误信息
知道我可以尝试什么吗?
提前致谢!
【问题讨论】:
-
因为你还没有定义
lint任务。 -
谢谢你。我想到了类似的事情。但是为什么 Keystone 不创建 lint 任务呢?
-
你好。我有同样的问题。
-
嗨。我现在已经删除了监视任务。我的一个同事也遇到过这个问题。
-
在 GitHub 上打开了一个问题。如果有人对此感兴趣:github.com/keystonejs/generator-keystone/issues/193
标签: node.js gulp keystonejs