slushjs / gulp-install

Automatically install npm and bower packages if package.json or bower.json is found in the gulp file stream respectively
MIT License
106 stars 46 forks source link

Fail to use gulp-install with yarn in private package manager #60

Open lamaldonado opened 6 years ago

lamaldonado commented 6 years ago

I'm getting problems using yarn with private package manager

My code:

install() {
    let gulp = this.gulp;
    gulp.task('install', function () {
        return gulp
            .src(['./package.json', './yarn.lock', './.npmrc'])
            .pipe(gulp.dest('./build/'))
            .pipe(install({
              commands: {
                'package.json': 'yarn'
              },
              yarn: ['--verbose', '--production']
            }));
    });
    return this;
}

.npmrc file:

registry=http://{internalServer}
//{internalServer}/:_authToken={Token}
//{internalServer}/:always-auth=true

When the pipeline in GitlabCI runs, I got this error:

error An unexpected error occurred: "http://{internalServer}/buffer/-/buffer-4.9.1.tgz: Request failed \"403 Forbidden\"".

Then running yarn with verbose mode, I can see that it recognize the .npm file

verbose 0.577 Found configuration file "/{path-to-my-module}/build/.npmrc"
verbose 0.578 Found configuration file "/{path-to-my-module}/.npmrc".

Any help is appreciated