storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.09k stars 9.25k forks source link

Can't install: Pull is not possible because you have unmerged files. #3410

Closed er-dev closed 6 years ago

er-dev commented 6 years ago

When running getstorybook I receive an error that it cannot install dependencies because I have unmerged files in git. I do not:

git status output:

On branch va5
Your branch is up-to-date with 'origin/va5'.
nothing to commit, working directory clean

git diff has no output

Steps to reproduce

Run getstorybook

OS X 10.11.6 Node 8.9.1 NPM 5.6.0 In a brand new bare Meteor app (created with meteor create xyz --bare)

Screenshots / Screencast / Code Snippets (Optional)

 getstorybook - the simplest way to add a storybook to your project.

 • Detecting project type. ✓
 • Adding storybook support to your "React" app. ✓
 • Preparing to install dependencies. ✓

yarn install v0.22.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning @storybook/react > webpack-hot-middleware@2.22.0: Accidentally doesn't hot reload if warnings are seen
error Command failed.
Exit code: 128
Command: git
Arguments: pull
Directory: /Users/andrew/Library/Caches/Yarn/v1/.tmp/a71eb20c6f8366926c96610aa7b336f4
Output:
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

 • Installing dependencies. ✖

     An error occurred while installing dependencies.
er-dev commented 6 years ago

After receiving that error, I ran git status again:

On branch va5
Your branch is up-to-date with 'origin/va5'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   package.json

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .storybook/
    stories/

So I added the untracked files to git and commited them.

git status came back clean after that:

On branch va5
Your branch is up-to-date with 'origin/va5'.
nothing to commit, working directory clean

So I ran getstorybook again and received this message:

 getstorybook - the simplest way to add a storybook to your project.

 • Detecting project type. ✓

    There seems to be a storybook already available in this project.
    Apply following command to force:

   getstorybook -f

But I know the dependencies are not installed because of the original error.

I then ran getstorybook -f and received the original error again.

So I ran npm install which added 97 packages, removed 172 packages, updated 55 packages and moved 9 packages in 18.99s

And received a webpack compilation error about @babel/core.

I found this issue and ran npm i -g @storybook/cli@3.3.15, removed Storybook from my project entirely, and followed my steps again. This time, after running npm install, storybook works.

This was quite the workaround way to install Storybook, is this intentional?

Hypnosphi commented 6 years ago

I wasn't able to reproduce it using following steps:

npm i -g create-react-app @storybook/cli
create-react-app test
cd test
git init
git add -A
git commit -m init
getstorybook

Can you please create a GitHub repo with minimal reproduction of your issue?

er-dev commented 6 years ago

I am not using create-react-app, but Meteor instead:

curl https://install.meteor.com/ | sh
meteor create test --bare
cd test/
git init
git add -A
git commit -m init
getstorybook
 getstorybook - the simplest way to add a storybook to your project.

 • Detecting project type. ✓
 • Adding storybook support to your "Meteor" app. ✓
 • Preparing to install dependencies. ✓

yarn install v0.22.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning babel-root-slash-import > babel@6.23.0: In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers
warning @storybook/react > webpack-hot-middleware@2.22.0: Accidentally doesn't hot reload if warnings are seen
error Command failed.
Exit code: 128
Command: git
Arguments: pull
Directory: /Users/andrew/Library/Caches/Yarn/v1/.tmp/a71eb20c6f8366926c96610aa7b336f4
Output:
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

 • Installing dependencies. ✖

     An error occurred while installing dependencies.
Hypnosphi commented 6 years ago

Looks like you're using a very outdated version of yarn. Please try installing the latest one https://yarnpkg.com/en/docs/install

Hypnosphi commented 6 years ago

3453 should help in cases like yours, when you have an old yarn installed which you don't actually use

er-dev commented 6 years ago

Updated to Yarn 1.6.0. Still receiving an error installing dependencies:

 getstorybook - the simplest way to add a storybook to your project.

 • Detecting project type. ✓
 • Adding storybook support to your "Meteor" app. ✓
 • Preparing to install dependencies. ✓

yarn install v1.6.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: pull
Directory: /Users/andrew/Library/Caches/Yarn/v1/.tmp/a71eb20c6f8366926c96610aa7b336f4
Output:
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

 • Installing dependencies. ✖

     An error occurred while installing dependencies.

   ╭───────────────────────────────────────────╮
   │                                           │
   │     Update available 3.3.15 → 3.4.2       │
   │   Run npm i -g @storybook/cli to update   │
   │                                           │
   ╰───────────────────────────────────────────╯

But meteor npm install works to install them, and npm run storybook works now.

Updating yarn fixed the issue with the Git errors.

Hypnosphi commented 6 years ago

Run npm i -g @storybook/cli to update

Did you try that?