NPM安装错误:RangeError:超出最大调用堆栈大小

时间:2015-10-21 19:12:02

标签: node.js ubuntu npm

我正在尝试从package.json文件在Ubuntu 14.04.3(Linux ubuntu 3.13.0-45-generic#74-Ubuntu)上安装我的npm依赖项。我不知道它是否重要,但Ubuntu是一个虚拟机。我在/ tmp目录中安装依赖项,因此它不是任何共享文件夹或samba资源。

Node.js版本:0.12.7。

Npm版本:3.3.9。

的package.json:

{
    ...
    "devDependencies": {
        "babel-loader": "5.3.*",
        "bootstrap": "3.3.*",
        "css-loader": "0.19.*",
        "del": "2.0.*",
        "extract-text-webpack-plugin": "0.8.*",
        "file-loader": "0.8.*",
        "gulp": "3.9.*",
        "gulp-eslint": "1.0.*",
        "gulp-util": "3.0.*",
        "html-loader": "0.3.*",
        "karma": "0.13.*",
        "karma-chai-plugins": "0.6.*",
        "karma-mocha": "0.2.*",
        "karma-phantomjs-launcher": "0.2.*",
        "karma-webpack": "1.7.*",
        "mocha": "2.3.*",
        "phantomjs": "1.9.*",
        "style-loader": "0.12.*",
        "url-loader": "0.5.*",
        "webpack": "1.12.*",
        "yargs": "3.27.*"
    },
    "engines": {
        "node": ">= 0.12.0"
    }
    "dependencies": {
        "express": "4.13.*"
    }
}

我使用--no-bin-links安装标志(我需要将node_modules目录复制到另一个基于NTFS的位置)。

当我安装依赖项时,我遇到以下错误:

RangeError: Maximum call stack size exceeded
    at emit (events.js:107:17)
    at null.<anonymous>(/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js:14:10)
    at emit (events.js:107:17)
    at null.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js:14:10)
    at emit (events.js:107:17)
    at null.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js:14:10)
    at emit (events.js:107:17)
    at null.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js:14:10)
    at emit (events.js:107:17)
at TrackerGroup.finish (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js:60:8)

有人知道如何解决它吗?

1 个答案:

答案 0 :(得分:1)

您最有可能遇到的NPM问题#9224#9239

要解决这些问题,您可以将包安装到--no-bin-links而不带rsync -L标记,并确保之后用文件/目录替换符号链接。您可以使用var gulp = require('gulp'); var sass = require('gulp-sass'); var watch = require('gulp-watch'); var browserSync = require('browser-sync').create(); // for live-editing gulp.task('default', function(){ // Serve files from the root of this project browserSync.init({ server: "./" }); gulp.watch('sass/**/*.scss', ['styles']); //-----***** RELOADING of HTML *****----- gulp.watch("*.html").on("change", browserSync.reload); }); gulp.task('styles', function(){ gulp.src('sass/**/*.scss') .pipe(sass().on('error', sass.logError)) .pipe( gulp.dest('./css')) //-----***** RELOADING of CSS *****----- .pipe(browserSync.stream()); });将文件复制到NTFS,并将符号链接转换为引用文件和目录。