fsevents (pulled in by chokidar) in npm shrinkwrap causes build to fail on Windows
Asked Answered
A

1

7

OSX only fsevents is listed in the npm shrinkwrap because it's pulled in by chokidar. Our production is Linux based and it didn't cause any trouble there, obviously OSX developers are fine too, but it broke npm install on my Win x64 environment.

How can I fix that?

C:\Users\User\Documents\splive>npm install
(node:2888) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

> [email protected] install C:\Users\User\Documents\splive\node_modules\fsevents
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.8/fse-v1.0.8-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)
Traceback (most recent call last):
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
    return gyp_main(args)
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2003, in GenerateOutput
    sln_projects, project_objects, flat=msvs_version.FlatSolution())
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1762, in _GatherSolutionFolders
    return _DictsToFolders('', root, flat)
  File "C:\Users\User\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1715, in _DictsToFolders
    for folder, contents in bucket.iteritems():
AttributeError: 'MSVSProject' object has no attribute 'iteritems'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\User\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
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:204:12)
gyp ERR! System Windows_NT 10.0.14388
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\User\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\User\\Documents\\splive\\node_modules\\fsevents\\lib\\binding\\Release\\node-v48-win32-x64\\fse.node" "--module_name=fse" "--module_path=C:\\Users\\User\\Documents\\splive\\node_modules\\fsevents\\lib\\binding\\Release\\node-v48-win32-x64" "--python=C:\\Python27\\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Users\User\Documents\splive\node_modules\fsevents
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\User\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\User\Documents\splive\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64\fse.node --module_name=fse --module_path=C:\Users\User\Documents\splive\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64 --python=C:\Python27\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\User\Documents\splive\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:852:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
node-pre-gyp ERR! System Windows_NT 10.0.14388
node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\User\\Documents\\splive\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\User\Documents\splive\node_modules\fsevents
node-pre-gyp ERR! node -v v6.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.29
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\User\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\User\Documents\splive\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64\fse.node --module_name=fse --module_path=C:\Users\User\Documents\splive\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64 --python=C:\Python27\python.exe --msvs_version=2015' (1)
npm WARN install:[email protected] [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN install:[email protected] Exit status 1

complete output: http://pastebin.com/WNy0pmqK

Anyone encountered this? How to overcome this?


Info about my system:

I'm using Node.js 6.4 right now (tried to upgrade form 5.3 so it may help). Npm version is 3.10.5 although I tried to downgrade to 3.3.12 because certain npm issues suggested that. I'm on x64 Win 10 Insider latest Slow ring build.


This might be related but none of the solutions worked and it's not really about shrinkwrap: node-gyp build error windows x64

Might be related git issues:

Appall answered 21/7, 2016 at 19:23 Comment(4)
Now it fails even if I delete fsevent manually form the shrinkwrap. Chokidar is a package which is pulled in transitively also. Anyone has an idea how to deal with this? Everyone is using now Mac?Appall
Please comment your node, npm version and system if you suffer from the same thing so maybe we can figure out some patterns.Appall
This fsevents is trippin' on Linux as well BTW. Ridiculous, Mac is like a plagueAppall
I'm having this exact issue on Windows 7 with Node 8.9.4 / npm 5.6.0. No macs or Linux used anywhere on this project. "npm install" doesn't install fsevents, but does add it to the shrinkwrap file. If I check that change in, it causes npm install to fail on the build server.Nonfeasance
N
1

Use npm install --no-optional to install your packages without adding fsevents to the shrinkwrap file. (If there are references to fsevents in there already, remove them manually.)

I discovered this option via another Stack Overflow question: error [email protected] in windows 7

Nonfeasance answered 23/2, 2018 at 17:24 Comment(1)
That looks like a good solution, but unfortunately my main OS is Linux again for the last 2+ years so I cannot test this. I haven't ran into this specific one on Linux with the exact same codebase, although fsevents is not Linux compatible either. So theoretically it should be a problem there as well, but it never materialized.Appall

© 2022 - 2024 — McMap. All rights reserved.