Bit: Bit Commit and Bit Export throws "Error: Cannot find module"

Created on 1 May 2017  路  4Comments  路  Source: teambit/bit

Sorry for all the overkill. I love the spirit of this project and thought this detailed error report would help.
TLDR: Use recommended npm install on mac(scroll down to #3rd Attempt, cant get this markdown link to work...)

Machine spec via image:
screen shot 2017-05-01 at 09 28 31

1st Attempt(didn't work)

Bit installed with brew:
screen shot 2017-05-01 at 09 38 12

While following the walkthrough I came upon these errors when running the following commands:
bit commit is-string 'initial commit' Note that the commit seems to have been executed successfully despite the error.

screen shot 2017-05-01 at 09 34 23

bit export @this/is-string @scopy produces same directory type error:

screen shot 2017-05-01 at 09 35 16

Second Attempt(didn't work)

I rm -rf the hello-world and scopy directory and tried the steps again only this time i ran npm init -y on the hello-world dir before running npm i -bit-js because without doing the npm i bit-js installed bit-js one level up. This produced the same result up to this point. Screenshots below:

screen shot 2017-05-01 at 09 38 12
screen shot 2017-05-01 at 09 48 37
screen shot 2017-05-01 at 09 49 51

3rd Attempt(Works!)

## 3rd Attempt(Works!)
Steps:

  1. rm -rf hello-world and scopy directories.
  2. brew remove bit
  3. Install bit globally with npm.

screen shot 2017-05-01 at 10 05 05

  1. Follow getting started instructions, successful bit commit which failed previously.
    screen shot 2017-05-01 at 10 09 27

  2. I run npm init on hello-world so npm i bit installs in /hello-world dir instead of parent.
    Run npm init.
    screen shot 2017-05-01 at 10 31 15
    Run npm i bit-js.
    screen shot 2017-05-01 at 10 31 34

  3. Creating index.js, bit commit. Works. bit show @this/is-string. Works.
    screen shot 2017-05-01 at 10 31 59

  4. bit status. Works.
    screen shot 2017-05-01 at 10 32 17

  5. Create scopy dir for remotes, add remotes, export (bit remote add, bit export) commands work. bit remote add file:///Users/devworx/scopy --global.
    screen shot 2017-05-01 at 10 41 47

Most helpful comment

@itaymendel You can close this, the new version is in Homebrew.

All 4 comments

Epic issue breakdown @idkjs :)
So it seems that the release that was pushed to Brew was missing a file.
Anyway, we've published a new PR to Brew that will fix it.

For now, keep using the NPM, and thanks for not giving up!

I'm keeping this issue open until the new version is published to Brew.

@itaymendel You can close this, the new version is in Homebrew.

thanks @neutric

Glad to help in this minor way. Anyone now how to fix the internal markdown link?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amadeogallardo picture amadeogallardo  路  4Comments

williamluke4 picture williamluke4  路  4Comments

KutnerBitsrc picture KutnerBitsrc  路  4Comments

hwclass picture hwclass  路  3Comments

JamesNorris11 picture JamesNorris11  路  4Comments