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

Error installing with npm on windows #3

Open
JMoura5 opened this issue Jul 4, 2017 · 3 comments
Open

Error installing with npm on windows #3

JMoura5 opened this issue Jul 4, 2017 · 3 comments

Comments

@JMoura5
Copy link

JMoura5 commented Jul 4, 2017

Hi, I'm having trouble installing node-svd via npm. I've already installed node-gyp and confirmed that it is working and the variables python and msbuild are available at my environment but am still getting this error:

C:\Users\Joao\Documents\Thesis\DamVis>npm install node-svd --save

> [email protected] install C:\Users\Joao\Documents\Thesis\DamVis\node_modules\node-svd
> node-gyp rebuild && cp build/Release/svd.node ./svd.node


C:\Users\Joao\Documents\Thesis\DamVis\node_modules\node-svd>if not defined npm_config_node_gyp (node "C:\Users\Joao\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  las2.c
  svdutil.c
  svdlib.c
..\svdlib.c(201): warning C4098: 'svdWriteDenseArray': função 'void' retornando um valor [C:\Users\Joao\Documents\Dropb
ox\Thesis\DamVis\node_modules\node-svd\build\svd.vcxproj]
..\svdutil.c(40): fatal error C1083: Não é possível abrir arquivo incluir: 'netinet/in.h': No such file or directory [C
:\Users\Joao\Documents\Thesis\DamVis\node_modules\node-svd\build\svd.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Joao\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Joao\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Joao\Documents\Thesis\DamVis\node_modules\node-svd
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild && cp build/Release/svd.node ./svd.node`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Joao\AppData\Roaming\npm-cache\_logs\2017-07-04T21_10_11_881Z-debug.log

If you go to https://npm.runkit.com/node-svd it also gives an error saying it couldn't find 'node-svd'. Any suggestion on how I might solve this?

Thanks.

@JMoura5
Copy link
Author

JMoura5 commented Jul 5, 2017

After a few more hours trying to understand the problem, I now think that the issue is that netinet/in.h file is not available on Windows. I'm able to install successfully other packages that are using node-gyp, so that's not the problem.

My conclusion is that this package is not intended (or was simply not tested) to work on Windows. Do you think that there is a workaround to this?

Thank you once again.

@xionluhnis
Copy link
Owner

I have never used nodejs/npm on windows and have not access to a windows development environment, so it may be hard for me to help.
Indeed, netinet/in.h doesn't exist on windows. Usually, people use winsock.h instead on windows, but I am not sure that will solve your problem because looking at the code of svdlibc, it uses bash commands and pipes to execute the file operations (which node doesn't need, it's just part of svdlibc). I don't know whether these would work with windows anyway.

Options:

  1. You can try installing cygwin and compiling svdlibc from within a bash terminal
  2. You could try removing the include<inet/in.h> as well as all unnecessary functions in svdlib.c/h, svdutil.c/h and las2.c

The "main" program for nodejs is basically in svd.cc. The functions that are needed there are:

svdNewDMat
svdConvertDtoS
svdFreeDMat
svdLAS2A
svdFreeSMat
svdFreeSVDRec

but of course, keeping only these may not work as the implementation of these functions may require other functions, so it may become a pain, although that would be the simplest way to make it work without adding any new code.

@xionluhnis xionluhnis changed the title Error installing on npm Error installing with npm on windows Jul 10, 2017
@JMoura5
Copy link
Author

JMoura5 commented Jul 12, 2017

I forked the repository and got it working by removing the unnecessary functions and header files of svdlibc to this module. Also changed the npm install script so that all is compatible with Windows.

Thank you so much for your help!

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