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

npm install fails on Windows #13

Closed
ImOnALampshade opened this issue Feb 24, 2018 · 14 comments
Closed

npm install fails on Windows #13

ImOnALampshade opened this issue Feb 24, 2018 · 14 comments
Assignees

Comments

@ImOnALampshade
Copy link

ImOnALampshade commented Feb 24, 2018

NPM install fails on windows with message:

> mmap-io@1.0.0 postinstall C:\Users\howard\data\Workspace\node-named-pipe-test\node_modules\mmap-io
> make ls

'make' is not recognized as an internal or external command,
operable program or batch file.
npm WARN named-pipe-test@1.0.0 No description
npm WARN named-pipe-test@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mmap-io@1.0.0 postinstall: `make ls`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmap-io@1.0.0 postinstall 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\howard\AppData\Roaming\npm-cache\_logs\2018-02-24T07_42_20_854Z-debug.log
@ozra ozra self-assigned this Feb 26, 2018
@grrrwaaa
Copy link

grrrwaaa commented Feb 27, 2018

Not sure if this is the same issue, but I get a build error of error C3861: 'uv_get_osfhandle': identifier not found

@grrrwaaa
Copy link

grrrwaaa commented Feb 27, 2018

Whoops, found that my issue is the same as #11 -- need to update my node.js. Would be good to document the version required; currently the package.json says "node": ">=0.10.0"

After installing Node 8.9.4 I am seeing the same issue as the OP: 'make' is not recognized as an internal or external command. Seems to be triggered by the postinstall script in package.json. What is make ls for?

@ImOnALampshade
Copy link
Author

I ended up making my own package after not getting any response on this issue, you can view it on my profile (node-filemap).

@grrrwaaa
Copy link

Well I need both unix and windows support, so I might take a shot at forking mmap-io and doing a PR if I can get it to play nice.

@ImOnALampshade
Copy link
Author

Fair enough - if not, I'm supporting both windows and unix with my package - I use mmap-io on unix and node-filemap on windows, then try { requrie(...) }

@grrrwaaa
Copy link

grrrwaaa commented Mar 2, 2018

Would have liked to fork mmap-io and add windows support, but the API seems too closely tied to *nix. So I've thrown together a very minimal module that fits my requirements here instead.

@ozra
Copy link
Owner

ozra commented Mar 5, 2018

Feel free to PR - or fork for own sake. Make is the traditional build tool. I'm rather preoccupied atm, but I try to be swift to merge PRs with fixes. Including the tiniest like version reqs in spec. Cheers!

@ozra
Copy link
Owner

ozra commented Mar 5, 2018

Oh, and it should already work for win, btw. If you install make.

@ImOnALampshade
Copy link
Author

You shouldn't be required make on windows, node gyp should handle everything.

@ozra
Copy link
Owner

ozra commented Mar 5, 2018

Yes, it could definitely be worked out, it's up for grabs!

@ozra
Copy link
Owner

ozra commented Mar 5, 2018

If anyone has the minutes to take this on, I suggest this approach (which I would accept):

  • Look in the Makefile for the few things needed — not many are essential for function
  • The LS-source files could be eliminated, and the built js be used as originals instead from now on, this removes one build step, and the dependency on an esoteric language in favour of plain JS.

I'm close to a deadline on a massive project, so I have no coding-time away from that atm., but these changes should be fairly easy for anyone feeling inclined.

@jhicks-camgian
Copy link

jhicks-camgian commented Apr 26, 2018

On Windows I use chocolatey to install nodejs-lts v8.11.1, miniconda 4.3.21 (Python-2), vcbuildtools 2015.4, and cyg-get 1.2.1

Using cyg-get I install a typical set of tools for C programming: make, gcc, autoconf, automake, bison, flex, etc.

Under the bash shell I export a PYTHON variable to reference the Miniconda's python.exe:

export PYTHON=$(cygpath -m /cygdrive/c/ProgramData/Miniconda2/python)

$ git clone https://github.com/ozra/mmap-io.git

$ cd mmap-io

$ npm install --save

There are a few gripes in the build, I think about pointer vs integer word sizes.

$ npm test

The test seems affirmative (with one small cosmetic problem at the end) but am really just starting to put time into evaluating it more closely, including some additional tests for sparse file and vm mapping support.

mmap-io@1.0.0 test C:\mmap-io
node ./test.js

mmap in test is { PROT_READ: 1,
PROT_WRITE: 2,
PROT_EXEC: 4,
PROT_NONE: 0,
MAP_SHARED: 1,
MAP_PRIVATE: 2,
MADV_NORMAL: 0,
MADV_RANDOM: 1,
MADV_SEQUENTIAL: 2,
MADV_WILLNEED: 3,
MADV_DONTNEED: 4,
PAGESIZE: 4096,
map: [Function],
advise: [Function],
incore: [Function],
sync_lib_private__: [Function],
sync: [Function] }
mmap.PAGESIZE = 4096 tries to overwrite it with 47
now mmap.PAGESIZE should be the same: 4096 silently kept
file size 5074
buflen 1 = 5074
Give advise with 2 args
Give advise with 4 args

Buffer contents, read byte for byte backwards and see that nothing explodes:

read out of bounds test
buflen test 5-arg map call = 5074
buflen test 4-arg map call = 5074
Pass faulty arg - caught deliberate exception: mmap: size (arg[0]) must be an integer
Pass wrong page-size as offset - caught deliberate exception: mmap failed, 40
Pass faulty arg to advise() - caught deliberate exception: advice(): (arg[1]) must be an integer
Now for some write/read tests
Creates file
open write buffer
fd-write = 8
open read bufer
verify write and read
Write/read verification seemed to work out
sync() tests x 4

  1. Does explicit blocking sync to disk
  2. Does explicit blocking sync without offset/length arguments
  3. Does explicit sync to disk without blocking/invalidate flags
  4. Does explicit sync with no additional arguments
    Failed to remove test-file ./tmp-mmap-file

All done

@ozra
Copy link
Owner

ozra commented Mar 8, 2019

I'll remove the dependency on GNU Make for the next update, I'll see what else I manage to squeeze into time.

@ozra
Copy link
Owner

ozra commented Apr 7, 2019

I've removed dependency on GNUMake, but the build commands still rely on a bunch of "common POSIX apps", so might require a basic setup on windows anyway. Try and see. I'm closing, so open new issue if required.

@ozra ozra closed this as completed Apr 7, 2019
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

4 participants