无法从离子Cli时4.1.2建立离子型版1(Can not build ionic version

2019-11-05 05:21发布

我有一个旧版本的离子一期工程,并进行了格式化Windows 7计算机。

安装离子CLI的4.1.2后,我试图建立这种离子版本1,项目,但它给我的错误信息:

无法运行青菜任务:在gulpfile.js失踪

完整的错误信息:

ionic-v1 build
[15:26:57] Cannot load gulp: Error: Error in module: .\gulpfile.js:
Error: Cannot find module ‘internal/util/types’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at evalmachine.:31:26
at Object. (C:\Users\myuser\myapp\node_modules\gulp\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:11:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
[15:26:57] Cannot run sass task: missing in gulpfile.js

我怎样才能编译版本离子的1个项目?

Answer 1:

尝试重新安装乙烯基-FS

$ rm -rf node_modules/vinyl-fs
$ npm install vinyl-fs


Answer 2:

同样的问题


var gulp = require('gulp');
var sass = require('gulp-sass');
var cleanCss = require('gulp-clean-css');
var rename = require('gulp-rename');

var paths = {
  sass: ['./scss/**/*.scss']
};

gulp.task('default', ['sass']);

gulp.task('sass', function(done) {
  gulp.src('./scss/ionic.app.scss')
    .pipe(sass())
    .on('error', sass.logError)
    .pipe(gulp.dest('./www/css/'))
    .pipe(cleanCss({
      keepSpecialComments: 0
    }))
    .pipe(rename({ extname: '.min.css' }))
    .pipe(gulp.dest('./www/css/'))
    .on('end', done);
});

gulp.task('watch', ['sass'], function() {
  gulp.watch(paths.sass, ['sass']);
});


文章来源: Can not build ionic version 1 from Ionic Cli 4.1.2