Bit: `npm install -g bit-bin` fails on Windows

Created on 10 Mar 2017  路  5Comments  路  Source: teambit/bit

After an install attempt from the VS2015 Developer's command line, it errors out:

..\src\posix.cc(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\kingd\
AppData\Roaming\npm\node_modules\bit-bin\node_modules\posix\build\posix.vcxproj]

Most helpful comment

Nevermind. I missed the note in the installation guide regarding Windows.

Note - Windows installations

If you are using Windows, add the --no-optional flag to the install command. npm install bit-bin --global --no-optional

@baoduy Hope this helps!

All 5 comments

Thanks for reporting this issue!
We're working to resolve it and will keep this thread posted.

Hi @kingdaro this issue is fixed with the latest bit release

Hi All
I'm still facing the issue on Window 10 event the Window-tools and Python are installed.
Please share tip how to resolve it?

  posix.cc
  win_delay_load_hook.cc
..\src\posix.cc(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\Steven
\AppData\Roaming\npm\node_modules\bit-bin\node_modules\posix\build\posix.vcxproj]

Same here. Any update?

It looks to have something to do with a dependency on posix which doesn't (or shouldn't) apply to Windows.

> npm i -g posix

> [email protected] install C:\Users\MyUser\AppData\Roaming\npm\node_modules\posix
> node-gyp rebuild


C:\Users\MyUser\AppData\Roaming\npm\node_modules\posix>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  posix.cc
  win_delay_load_hook.cc
..\src\posix.cc(2): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\MyUser
\AppData\Roaming\npm\node_modules\posix\build\posix.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\MyUser\AppData\Roaming\npm\node_modules\posix
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
+ [email protected]
added 2 packages from 9 contributors in 2.168s

Nevermind. I missed the note in the installation guide regarding Windows.

Note - Windows installations

If you are using Windows, add the --no-optional flag to the install command. npm install bit-bin --global --no-optional

@baoduy Hope this helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seed-of-apricot picture seed-of-apricot  路  21Comments

poriaz picture poriaz  路  15Comments

itaymendel picture itaymendel  路  16Comments

ranm8 picture ranm8  路  16Comments

nsams picture nsams  路  12Comments