Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignores package-lock.json #16

Open
pgraham opened this issue Apr 16, 2018 · 0 comments
Open

Ignores package-lock.json #16

pgraham opened this issue Apr 16, 2018 · 0 comments

Comments

@pgraham
Copy link

pgraham commented Apr 16, 2018

Directory contents:

- gulpfile.js
+ /dist
  - package.json
  - package-lock.json

gulpfile.js

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

gulp.task('npm-shrinkwrap', () => {
    return gulp.src('dist/package.json')
        .pipe(shrinkwrap())
        .pipe('dist/');
});

gulp.task('default', [ 'npm-shrinkwrap' ]);

Running gulp from the top level directory produces the following output:

Starting 'npm-shrinkwrap'...
npm WARN invalid config loglevel="notice"
wrote npm-shrinkwrap.json

And the contents of dist/ are:

+ /dist
  - package.json
  - package-lock.json
  - npm-shrinkwrap.json

However, if I cd into dist/ and run npm shrinkwrap this is the output and directory listing:

npm notice package-lock.json has been renamed to npm-shrinkwrap.json. npm-shrinkwrap.json will be used for future installations.
+ /dist
  - package.json
  - npm-shrinkwrap.json

Steps to reproduce:

  1. Run gulp-shrinkwrap against a package.json file that is a sibling of a package-lock.json file.

Expected results: package-lock.json is renamed to npm-shrinkwrap.json

Actual results: a new npm-shrinkwrap.json file is generated and the existing package-lock.json file is left intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant