eject success
eject fail with this error message: Command failed: git checkout 1.1.27
"my-library": "https://bitbucket.org/my-library.git#1.1.27",bit eject(I don't have 1.1.27 branch, so I guess the eject command was misguided by the dependency's format?)
Thanks for the help in advance.
@oahehc That indeed looks like the eject was misguided by the dependency's format as you said.
The eject final step is to run npm/yarn install to install the component as a regular package.
This, of course, might lead to install other dependencies.
Where is this dependency defined? in the component's package.json or in the project pacakge.json?
Does npm install (without bit) for this pacakge.json / dependency is working?
Hi @GiladShoham
Where is this dependency defined?
Ans: in the project pacakge.json
Does npm install (without bit) for this pacakge.json / dependency is working?
Ans. Yes, it will do something like npm i https://bitbucket.org/my-library.git#1.1.27 to install this library.
Hi @oahehc ,
I was working to reproduce the issue. I created a new repo on my Bitbucket account, generated a new tag, added to my package.json in the same format you have (https not ssh), exported a new component and then I was running bit eject component-id, it was working with no issues. It was able to run npm install of the project package.json file.
I was also trying to use the same node version as yours (v8.11.4), still no luck.
If you can provide a reproduce tar/zip, it'd be great. (you can send it to [email protected]).
Hi @davidfirst
Thanks for the help.
I created a test repo and bit collection.
Follow the steps below should be able to reproduce the error.
I guess it might be related to the name of repo and bit collection which have the same prefix.
Error Message:
eject failed installing the components using the NPM client.
your package.json (if existed) has been restored, however, some bit generated data may have been deleted, please run "bit link" to restore them.
got the following error: failed running npm install at /Users/andrew/Documents/andrew/_test/test2
npm ERR! code 1
npm ERR! Command failed: git checkout 1.0.0
npm ERR! error: pathspec '1.0.0' did not match any file(s) known to git.
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andrew/.npm/_logs/2019-05-02T00_38_36_681Z-debug.log
@oahehc thank you for the detailed explanation, it was super easy for me to reproduce :)
The problem here is a combination of two things.
yarn and npm interpret #1.0.0 differently.npm install https://github.com/oahehc/bit-test\#1.0.0, it throws the error you got before. The reason is that NPM tries to git checkout 1.0.0, which doesn't exist. Changing it to npm install https://github.com/oahehc/bit-test\#v1.0.0 (with the prefix v) works just fine.[email protected]. That's why with Yarn you don't get any error.yarn to install your packages, it'll make sense to you to change the Bit settings to use yarn."packageManager": "npm" with "packageManager": "yarn".I tried both, changing from '1.0.0' to 'v1.0.0' and changing from 'npm' to 'yarn', both work.
@davidfirst
Thanks a lot.
eject successfully after replacing packageManager to yarn.
Most helpful comment
@davidfirst
Thanks a lot.
eject successfully after replacing packageManager to yarn.