greenkeeperio / greenkeeper-lockfile

:lock: Your lockfile, up to date, all the time
https://greenkeeper.io
183 stars 73 forks source link

Travis + Yarn not updating lockfile #22

Closed john-griffin closed 7 years ago

john-griffin commented 7 years ago

Just got first PR after initial config with greenkeeper-lockfile. This is the output from travis:

$ greenkeeper-lockfile-update
error Received malformed response from registry for undefined. The registry may be down.
child_process.js:526
    throw err;
    ^
Error: Command failed: yarn add -D --save-prefix="" ember-cli-mirage@0.3.2
error Received malformed response from registry for undefined. The registry may be down.
    at checkExecSyncError (child_process.js:483:13)
    at execSync (child_process.js:523:13)
    at updateLockfile (/home/travis/.config/yarn/global/node_modules/greenkeeper-lockfile/lib/update-lockfile.js:26:7)
    at Module.update [as exports] (/home/travis/.config/yarn/global/node_modules/greenkeeper-lockfile/update.js:49:3)
    at Object.<anonymous> (/home/travis/.config/yarn/global/node_modules/greenkeeper-lockfile/update.js:56:37)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
The command "greenkeeper-lockfile-update" failed and exited with 1 during .
$ node --version
v6.9.2
$ npm --version
3.10.9
$ nvm --version
0.33.2

--save-prefix does not appear to be a valid option for yarn.

boennemann commented 7 years ago

Hey @john-griffin,

thanks for this report. In my testing it didn't fail with this option, but maybe in your case it does, because it's empty 🤔

Do you know if there's a way to tell yarn what prefix to use? Otherwise we could just easily leave it off entirely for now.

The logic is located here: https://github.com/greenkeeperio/greenkeeper-lockfile/blob/master/lib/update-lockfile.js#L26

Best, Stephan

john-griffin commented 7 years ago

@boennemann thanks for quick response. I think if its empty then it would need to use the exact option https://yarnpkg.com/en/docs/cli/add#toc-yarn-add-exact-e.

There is also a tilde option https://yarnpkg.com/en/docs/cli/add#toc-yarn-add-tilde-t.

Couldn't find anything equivalent to save-prefix.

john-griffin commented 7 years ago

@boennemann building the args as ${dependency.name}@${dependency.prefix}${dependency.version} would work right?

boennemann commented 7 years ago

@john-griffin What do you think about this one? https://github.com/greenkeeperio/greenkeeper-lockfile/pull/23