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

Can't install from NPM #2628

Closed
rjamesnw opened this issue Apr 5, 2019 · 7 comments
Closed

Can't install from NPM #2628

rjamesnw opened this issue Apr 5, 2019 · 7 comments

Comments

@rjamesnw
Copy link

rjamesnw commented Apr 5, 2019

system info

OS: Windows Server 2012 R2
Installed: NodeJS. NPM, Python
Haraka Version: Latest from NPM

Expected behavior

To install.

Observed behavior

Does not install.

Steps to reproduce

C:\Windows\system32>npm -g install Haraka
C:\Users---\AppData\Roaming\npm\spf -> C:\Users---\AppData\Roaming\npm\node_modules\Haraka\bin\spf
C:\Users---\AppData\Roaming\npm\haraka_grep -> C:\Users---\AppData\Roaming\npm\node_modules\Haraka\bin\haraka_grep
C:\Users---\AppData\Roaming\npm\dkimverify -> C:\Users---\AppData\Roaming\npm\node_modules\Haraka\bin\dkimverify
C:\Users---\AppData\Roaming\npm\haraka -> C:\Users---\AppData\Roaming\npm\node_modules\Haraka\bin\haraka

dtrace-provider@0.8.7 install C:\Users---\AppData\Roaming\npm\node_modules\Haraka\node_modules\dtrace-provider
node-gyp rebuild || node suppress-error.js

C:\Users---\AppData\Roaming\npm\node_modules\Haraka\node_modules\dtrace-provider>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_module
s\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 )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 6.3.9600
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---\AppData\Roaming\npm\node_modules\Haraka\node_modules\dtrace-provider
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

@Dexus
Copy link
Member

Dexus commented Apr 5, 2019 via email

@rjamesnw
Copy link
Author

rjamesnw commented Apr 5, 2019

Then I guess it should be noted in the installation instructions on the main site. :P ;) Python was obvious, given the other error that it was not found before this error. I guess it is not as easy as NPM install then, thanks.

@baudehlo
Copy link
Collaborator

baudehlo commented Apr 6, 2019 via email

@msimerson
Copy link
Member

msimerson commented Apr 10, 2019

While we (mostly me) have gone out of our way to make it possible to run Haraka on Windows, and even test all our builds on AppVeyor to avoid breaking it, we don't use or like Windows. Haraka has no official support. That said, and as @baudehlo said, we welcome any PRs that improve upon it.

@superman20
Copy link
Collaborator

FYI...I've been running on Windows for years without any issues. The instructions work if you have the 3 required prerequisites installed: 1) Node.js, 2) Python, 3) Visual Studio 2015 or 2017. My personal experience is:

  • I've had success with both Node.js LTS or Current versions
  • You should install Visual Studio manually (the free community edition is fine). Years ago, I do recall having trouble getting a properly working Visual Studio installation with the npm windows-build-tools package. Once you have a working VS installation, there will be hundreds of warnings that you can ignore during the Haraka install/compile phase.
  • Years ago, I recall having trouble using Python 3, but Python 2 seemed to work best. I've not had time to diagnose those issues (if they even still exist now). I still use Python 2 to avoid the hassle.
  • I compile Haraka on a development machine and copy the final result to the production machine. You don't need Visual Studio or Python where you run Haraka (just the Microsoft Visual C++ runtime that pairs with the Visual Studio version you used and Node.js).

Hope that helps you some.

@msimerson
Copy link
Member

Thanks @superman20 , I copied your post to an Install Guide for Windows on the wiki.

@superman20
Copy link
Collaborator

Actually after examining @rjamesnw errors in detail, it looks like he does indeed have a Python 2/3 problem. One of the breaking changes from version 2 to 3 was changing the Print statement to a Print() function. See the details here. Switching to Python 2 and making sure Visual Studio is properly installled should get you ALOT further.

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

5 participants