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

Unable to install under Windows #6

Closed
VboxNick opened this issue Jun 17, 2014 · 4 comments
Closed

Unable to install under Windows #6

VboxNick opened this issue Jun 17, 2014 · 4 comments

Comments

@VboxNick
Copy link

I try to install sync-prompt@0.4.0 and get an error. Is it a bug or my env misconfiguration?

Thanks.

C:\Users\nick\AppData\Roaming\npm\node_modules\sync-prompt>node "D:\Rnd\Tools\NodeJs\node_modules\npm\bin\node-gyp-bin\\..\..\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.
  sync_prompt.cc
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\nick\AppData\Roaming\npm\node_modules\sync-prompt\build\sync_prompt.vcxproj]
..\src\sync_prompt.cc(5): fatal error C1083: Cannot open include file: 'termios.h': No such file or directory [C:\Users\nick\AppData\Roaming\npm\node_modules\sync-prompt\build\sync_prompt.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Rnd\Tools\NodeJs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Rnd\\Tools\\NodeJs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\nick\AppData\Roaming\npm\node_modules\sync-prompt
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! sync-prompt@0.4.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sync-prompt@0.4.0 install script.
npm ERR! This is most likely a problem with the sync-prompt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sync-prompt
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\\Rnd\\Tools\\NodeJs\\\\node.exe" "D:\\Rnd\\Tools\\NodeJs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sync-prompt" "-g"
npm ERR! cwd C:\Users\nick
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\nick\npm-debug.log
npm ERR! not ok code 0

C:\Users\nick>
@shovon
Copy link
Owner

shovon commented Jun 17, 2014

Is it a bug or my env misconfiguration?

It's an issue with a lot of Windows environments. I have no clue what causes this. I tried compiling using Visual C++ 2013, and it works fine, but others have told me that they had both Visual C++ 2013 and Visual C++ 2012 installed on their machine, and things hit the fan.

And this doesn't just affect sync-prompt; this affects many other modules that are written in C++.


Currently, I'm reworking the code so that it is entirely written in JavaScript, instead of relying on C++.

Node.js' fs module has a method called readSync, that allows us to read data pointed by a file descriptor, instead of data pointed by a file name (typically, in most environments, you'd give a file name, and that environment will stream data to whatever is interested in the file's content).

Now, because we have the flexibility of providing whatever file descriptor we like, and also, because STDIN is a file descriptor itself, we can, therefore, pass STDIN to readSync, and then be able to read streamed data from it, just as we would from a file.

So let's see how that works out.

@VboxNick
Copy link
Author

I've got VS2010 and VS2012 installed. I was able to install bcrypt lib:

C:\Temp>npm install bcrypt --msvs_version=2012
npm http GET https://registry.npmjs.org/bcrypt
npm http 200 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bcrypt/-/bcrypt-0.7.8.tgz
npm http 200 https://registry.npmjs.org/bcrypt/-/bcrypt-0.7.8.tgz
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 200 https://registry.npmjs.org/bindings/1.0.0
npm http GET https://registry.npmjs.org/bindings/-/bindings-1.0.0.tgz
npm http 200 https://registry.npmjs.org/bindings/-/bindings-1.0.0.tgz

> bcrypt@0.7.8 install C:\Temp\node_modules\bcrypt
> node-gyp rebuild


C:\Temp\node_modules\bcrypt>node "D:\Rnd\Tools\NodeJs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuil
d
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  blowfish.cc
  bcrypt.cc
  bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=' : conversion from 'size_t' to 'unsigned char', possible loss of data [C:\Temp\node_modules\bcrypt
\build\bcrypt_lib.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantic
s are not enabled. Specify /EHsc (..\src\bcrypt_node.cc) [C:\Temp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(133): warning C4244: 'argument' : conversion from 'ssize_t' to 'unsigned char', possible loss of data [C:\Temp\node_m
odules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(207): warning C4244: 'argument' : conversion from 'const ssize_t' to 'unsigned char', possible loss of data [C:\Temp\
node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(298): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [C:\Temp\node_modules\
bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(299): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [C:\Temp\node_modules\
bcrypt\build\bcrypt_lib.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocnum(155): warning C4506: no definition for inline function 'v8::Persiste
nt<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Temp\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\bcrypt_node.cc)
     Creating library C:\Temp\node_modules\bcrypt\build\Release\bcrypt_lib.lib and object C:\Temp\node_modules\bcrypt\build\Release\bcrypt_
  lib.exp
  Generating code
  Finished generating code
  bcrypt_lib.vcxproj -> C:\Temp\node_modules\bcrypt\build\Release\\bcrypt_lib.node
bcrypt@0.7.8 node_modules\bcrypt
└── bindings@1.0.0

C:\Temp>

Sync-prompt@0.2.2 can be installed also:

C:\Temp>npm install sync-prompt@0.2.2 --msvs_version=2012
npm http GET https://registry.npmjs.org/sync-prompt/0.2.2
npm http 304 https://registry.npmjs.org/sync-prompt/0.2.2

> sync-prompt@0.2.2 install C:\Temp\node_modules\sync-prompt
> node-gyp rebuild


C:\Temp\node_modules\sync-prompt>node "D:\Rnd\Tools\NodeJs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" r
ebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  sync_prompt.cc
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantic
s are not enabled. Specify /EHsc [C:\Temp\node_modules\sync-prompt\build\sync_prompt.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xstring(1066): warning C4506: no definition for inline function 'v8::Persist
ent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Temp\node_modules\sync-prompt\build\sync_prompt.vcxproj]
          with
          [
              T=v8::Object
          ]
     Creating library C:\Temp\node_modules\sync-prompt\build\Release\sync_prompt.lib and object C:\Temp\node_modules\sync-prompt\build\Rele
  ase\sync_prompt.exp
  Generating code
  Finished generating code
  sync_prompt.vcxproj -> C:\Temp\node_modules\sync-prompt\build\Release\\sync_prompt.node
sync-prompt@0.2.2 node_modules\sync-prompt

C:\Temp>

But I still have issue with sync prompt 0.4.0:

C:\Temp\node_modules\sync-prompt>node "D:\Rnd\Tools\NodeJs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" r
ebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  sync_prompt.cc
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantic
s are not enabled. Specify /EHsc [C:\Temp\node_modules\sync-prompt\build\sync_prompt.vcxproj]
..\src\sync_prompt.cc(5): fatal error C1083: Cannot open include file: 'termios.h': No such file or directory [C:\Temp\node_modules\sync-pr
ompt\build\sync_prompt.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Rnd\Tools\NodeJs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Rnd\\Tools\\NodeJs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Temp\node_modules\sync-prompt
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! sync-prompt@0.4.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sync-prompt@0.4.0 install script.
npm ERR! This is most likely a problem with the sync-prompt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sync-prompt
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\\Rnd\\Tools\\NodeJs\\\\node.exe" "D:\\Rnd\\Tools\\NodeJs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sync-prompt" "
--msvs_version=2012"
npm ERR! cwd C:\Temp
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Temp\npm-debug.log
npm ERR! not ok code 0

C:\Temp>

The compiler can't find depended library and throw an error: "Cannot open include file: 'termios.h'". Any ideas?

@shovon shovon closed this as completed in e30831d Jun 21, 2014
@shovon
Copy link
Owner

shovon commented Jun 21, 2014

The compiler can't find throw error: "Cannot open include file: 'termios.h'". Any ideas?

Thanks for the heads up! Fixed, and you should be able to install sync-prompt@0.4.1.

Let me know if there are any more issues.

@VboxNick
Copy link
Author

It works. Thanks a lot. Have a good day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants