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

no carrot breaks on unpublished modules #93

Closed
kolodny opened this issue Mar 27, 2016 · 3 comments
Closed

no carrot breaks on unpublished modules #93

kolodny opened this issue Mar 27, 2016 · 3 comments

Comments

@kolodny
Copy link

kolodny commented Mar 27, 2016

For example in /packages/a/package.json, if I have "dependencies": { "b": "1.0.0" } if b is not published it will throw an error:

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/b

OTOH if I use "dependencies": { "b": "^1.0.0" } then it will work

This is all assuming that b is in the packages directory and has a version of 1.0.0

Something else I noticed was that after I successfully bootstrap with a carrot, I can then remove the carrot and subsequent calls to bootstrap will work

@kolodny
Copy link
Author

kolodny commented Mar 27, 2016

I started trying to play around with this and it seems that the master branch of lerna has this problem with the carrot as well as without. Here's the script to reproduce, I had lerna with npm link . as a sibling of this test directory

#!/bin/sh

rm -rf node_modules package.json .git packages
npm init -y > /dev/null
git init
npm link lerna
./node_modules/.bin/lerna init
echo 1.0.0 > VERSION
pkg1=p$RANDOM
pkg2=p$RANDOM
mkdir packages/$pkg1
cd packages/$pkg1
npm init -y > /dev/null
cd ../..
mkdir packages/$pkg2
cd packages/$pkg2
npm init -y > /dev/null

cat <<EOF | node
var pkg = require('./package.json');
pkg.dependencies = {$pkg1: '^1.0.0'}
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
EOF

cd ../..

./node_modules/.bin/lerna bootstrap

edit:

This script can reproduce the problem I was having with the carrot when lerna@v1.1.2 was checked out locally

@jamiebuilds
Copy link
Contributor

Fixed in 2.0.0-beta.4

@lock
Copy link

lock bot commented Dec 28, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants