簡體   English   中英

Gulp錯誤 - 錯誤:無法找到模塊'sigmund'

[英]Gulp error - Error: Cannot find module 'sigmund'

我的Gulp工作正常,直到我安裝了瀏覽器同步

npm install browser-sync gulp --save-dev

然后我開始得到這個錯誤:

錯誤:找不到模塊'lru-cache'

我用這個解決了: npm link lru-cache來自https://github.com/npm/npm/issues/1154

但是,現在當我嘗試運行gulp我得到了這個新錯誤:

〜/ Projects /starfeeder❯npminstall browser-sync gulp --save-dev npm WARN棄用minimatch@2.0.10:請更新到minimatch 3.0.2或更高版本以避免RegExp DoS問題npm WARN棄用node-uuid@1.4。 8:改用uuid模塊

fsevents@1.1.2 install / Users / leongaban / Projects / starfeeder / node_modules / fsevents節點安裝

我的gulpfile如果有幫助:

"use strict";
const gulp        = require('gulp'),
      _           = require('lodash'), // https://www.npmjs.com/package/lodash
      del         = require('del'), // https://www.npmjs.com/package/del
      fs          = require('fs'), // Node file system
      gutil       = require('gulp-util'), // https://www.npmjs.com/package/gulp-util
      htmlReplace = require('gulp-html-replace'), // https://www.npmjs.com/package/gulp-html-replace
      notify      = require("gulp-notify"), // https://www.npmjs.com/package/gulp-notify
      runSequence = require('run-sequence'), // https://www.npmjs.com/package/run-sequence
      sass        = require('gulp-ruby-sass'), // https://www.npmjs.com/package/gulp-ruby-sass
      sourcemaps  = require('gulp-sourcemaps'); // https://www.npmjs.com/package/gulp-sourcemaps

const rootPath = process.cwd();

const paths = {
    files: ['src/static/**']
};

const errorlog = err => {
    gutil.log(gutil.colors.red.bold.inverse('  ERROR: '+err));
    this.emit('end');
};

// Build tasks chain ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
gulp.task('build', function(cb) {
    runSequence(
        'build:app-css',      // Minify and concat app styles
        'build:move-files',
        'build:index',        // Replace scripts in index.html
        'build:final', cb);   // Remove app.min.js from build folder
});

gulp.task('build:move-files', () => gulp.src(paths.files).pipe(gulp.dest('starfeeder/')) );

// Preprocess SASS into CSS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
gulp.task('build:app-css', () => sass('src/sass/starfeeder.scss', { style: 'compressed' }).on('error', errorlog).pipe(gulp.dest('src/static/css/')) );

// Clear out all files and folders from build folder \\\\\\\\\\\\\\\\\\\\\\\\\\\
gulp.task('build:cleanfolder', cb => { del(['starfeeder/**'], cb); });

// Task to make the index file production ready \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
gulp.task('build:index', () => {
    process.stdout.write(gutil.colors.white.inverse(' New asset paths in markup: \n'));
    process.stdout.write(gutil.colors.yellow(' static/css/starfeeder.css\n'));

    gulp.src('index.html')
        .pipe(htmlReplace({
            'app-css': 'css/starfeeder.css'
        }))
        .pipe(gulp.dest('starfeeder/'))
        .pipe(notify('Starfeeder build created!'));
});

gulp.task('build:final', cb => {
    process.stdout.write(gutil.colors.blue.bold   ('######################################################     \n'));
    process.stdout.write(gutil.colors.blue.inverse('               Starfeeder build created!                   \n'));
    process.stdout.write(gutil.colors.blue.bold   ('######################################################     \n'));
});

// Main Styles /////////////////////////////////////////////////////////////////
gulp.task('app-css', () => {
    return sass('src/sass/starfeeder.scss', { style: 'compressed' })
    .pipe(sourcemaps.init())
    .on('error', errorlog)
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest('src/static/css/'))
});

// Development watch /////////////////////////////////////////////////////////// 🤖☕️⏎→
gulp.task('watch', () => {
    gulp.watch('src/sass/**/*.scss', ['app-css']).on('change', file => {
        let filePath = file.path.split(rootPath);
        logFileChanged(filePath[1]);
    });
});

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

我在安裝through2遇到了同樣的問題。 該項目使用了收縮包裝,並有一個package-lock.json ,導致依賴關系中斷。 一旦我取下鎖並重新安裝,一切都很好。

好的,所以仍然不確定為什么我會收到這些錯誤,但再也不會安裝browserSync。

我必須npm link我所有的gulp插件。

這項工作,但隨后在gulp build過程中崩潰了。

而不是做npm link到所有東西,包括我從未聽說過的其他節點模塊。 我刪除了browserSync並刪除了我的node_modules文件夾並yarn(npm) installyarn(npm) install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM