错误:找不到模块'camelcase'

时间:2017-08-09 13:52:36

标签: node.js ubuntu gulp debian gulp-sass

我正在尝试运行基于gulp的应用程序。 在Ubuntu上,一切正常,但在Debian服务器上没有。

Ubuntu:npm:5.3.0,nodejs:v8.2.1,bower @ 1.8.0,gulp-cli @ 1.4.0,npm @ 5.3.0

Debian:npm:5.3.0,nodejs:v8.2.1,bower @ 1.8.0,gulp-cli @ 1.4.0,npm @ 5.3.0

Gulpfile:

'use strict';

const gulp = require('gulp');
const sass = require('gulp-sass');

gulp.task('scss2css', function () {
    gulp.src(['./web/scss/style.scss'])
        .pipe(sass({outputStyle: 'compressed'}))
        .pipe(gulp.dest('./web/css/'));
});

gulp.task('scss2css:watch', function () {
    gulp.watch('./scss/**/*.scss', ['scss2css']);
});

gulp.task('default', function () {
    gulp.start('scss2css');
});

当我输入“gulp”时,我收到如下信息:

module.js:487
    throw err;
    ^

Error: Cannot find module 'camelcase'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/gulp-cli/node_modules/yargs/lib/parser.js:3:17)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

1 个答案:

答案 0 :(得分:0)

我刚删除了nodejs包和目录:

/usr/lib/node_modules/
/usr/local/lib/node_modules/