Closed timdp closed 9 years ago
Same issue here installing various projects - fsevents always fails even though it seems like it shouldn't be required on a Windows system? I'm on Windows 8.1 with msys2.
Same for me. npm/3.1.0 node/v0.12.7 win32 x64
same here
npm 3.1.2 / io.js v2.3.4 / osx 10.10.4
any fix, solution?
+1
Same issue here: node 0.12.7, npm 3.1.3, node-gyp 2.0.2 and Visual Studio 2015 on a Windows 8.1 x64 with environment variable GYP_MSVS_VERSION set to 2015
I've downgraded to npm 2.11.2 and the package was installed normally.
I've the issue but can't go back to npm < 3.0 because I really need flattened node_modules folder feature of npm 3.0. Really need a fix
I've gotten this error, but the modules worked fine anyways. Last time I specifically remember this happening is with webpack. Using 3.1.0 in Windows 8.1. Discussed in the fsevents repo in strongloop/fsevents#73.
And NPM is fixing the errors for optional modules: npm/npm#8921
@rchanou I just came across that npm issue myself. It looks like that's the real culprit.
Hey! Good news, this should be fixed in the just released npm@3.2.0
!
Awesome news @iarna just tested the new release right now and worked like a charm! Many thanks!
Thanks @iarna :)
Hey, @iarna! I still have this problem with npm 3.5.0.
npm install
> fsevents@0.3.8 install C:\_work\project\node_modules\fsevents
> node-gyp rebuild
C:\_work\project\node_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Traceback (most recent call last):
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 18, in <module>
sys.exit(gyp.script_main())
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 533, in script_main
return main(sys.argv[1:])
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 526, in main
return gyp_main(args)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 511, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2000, in GenerateOutput
sln_projects, project_objects, flat=msvs_version.FlatSolution())
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1759, in _GatherSolutionFolders
return _DictsToFolders('', root, flat)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1712, 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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:355:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\_work\project\node_modules\fsevents
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:fsevents@0.3.8 fsevents@0.3.8 install: `node-gyp rebuild`
npm WARN install:fsevents@0.3.8 Exit status 1
npm -v
3.5.0
We are using shrinkwrap.json if it's important.
If I delete shrinkwrap.json and node_modules folder then the problem goes away. But I get another warning
npm install
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.5
Not sure if the problem is solved because fsevents is updated after deleting shrinkwrap.json..
Help pls / PS C:\work\f8app> npm install
fsevents@1.0.11 install C:\work\f8app\node_modules\fsevents node-pre-gyp install --fallback-to-build
C:\work\f8app\node_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Users\Alexei\AppData\Roaming\npm\node_m odules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean )
C:\work\f8app\node_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Users\Alexei\AppData\Roaming\npm\node_m odules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\work \f8app\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64\fse.node --module_name=fse --module_path=C:\work\f8a pp\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64 --msvs_version=2013 ) else (node "" configure --fallbac k-to-build --module=C:\work\f8app\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64\fse.node --module_name=fs e --module_path=C:\work\f8app\node_modules\fsevents\lib\binding\Release\node-v48-win32-x64 --msvs_version=2013 ) Traceback (most recent call last): File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module
sys.exit(gyp.script_main())
File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gypinit.py", line 545, in script_main return main(sys.argv[1:]) File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gypinit.py", line 538, in main return gyp_main(args) File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gypinit.py", line 523, in gyp_main generator.GenerateOutput(flat_list, targets, data, params) File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", lin e 2003, in GenerateOutput sln_projects, project_objects, flat=msvs_version.FlatSolution()) File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", lin e 1762, in _GatherSolutionFolders return _DictsToFolders('', root, flat) File "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", lin e 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\Alexei\AppData\Roaming\npm\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.10586 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\work\f8app\node_modules\fseven ts\lib\binding\Release\node-v48-win32-x64\fse.node" "--module_name=fse" "--module_path=C:\work\f8app\node_module s\fsevents\lib\binding\Release\node-v48-win32-x64" "--msvs_version=2013" gyp ERR! cwd C:\work\f8app\node_modules\fsevents gyp ERR! node -v v6.2.0 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\work\f8app\node _modules\fsevents\lib\binding\Release\node-v48-win32-x64\fse.node --module_name=fse --module_path=C:\work\f8app\node_mod ules\fsevents\lib\binding\Release\node-v48-win32-x64 --msvs_version=2013' (1) node-pre-gyp ERR! stack at ChildProcess.(C:\work\f8app\node_modules\fsevents\node_modules\node-pre-gyp\l ib\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:850: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.10586 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\work\f8app\node_modules\fsevents\node_modules\ node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\work\f8app\node_modules\fsevents node-pre-gyp ERR! node -v v6.2.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.25 node-pre-gyp ERR! not ok Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\work\f8app\node_modules\fsevents\lib\binding\R elease\node-v48-win32-x64\fse.node --module_name=fse --module_path=C:\work\f8app\node_modules\fsevents\lib\binding\Relea se\node-v48-win32-x64 --msvs_version=2013' (1) npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Alexei\AppData\Roaming\npm\node_modules\npm\bin\n pm-cli.js" "install" npm ERR! node v6.2.0 npm ERR! npm v3.9.2 npm ERR! code ELIFECYCLE
npm ERR! fsevents@1.0.11 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fsevents@1.0.11 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fsevents package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fsevents
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls fsevents
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! C:\work\f8app\npm-debug.log
+1
This is no longer an issue if you follow the install steps from node-gyp module readme file.
Make sure you have the proper MSVS version installed, the correct env PATH set, and env vars set. Also update your Git version from the website, it solves a lot of issues. Make sure git is available from the CMD and only from Gitbash.
The only problem might be where npm modules are very old and outdated. There nothing you can do for this, unless you start raising PRs to fix them.
Also you can use node-gyp-install
from NPM to help you with node-gyp it that fails to download the proper files. Just install globally node gyp and run node-gyp-install after.
Still doesn't work with npm@3.9.5 on Windows 10... :/
[refack: fold the console output]
Ping, any update?
@bpasero If fsevents is in optionalDependencies, I think it should Just Work(TM). Speaking with both my fsevents and node-gyp maintainer hats on.
@bnoordhuis we use npm-shrinkwrap and so fsevents will be compiled even if it is a optional dependency. I think https://github.com/npm/npm/issues/12698 is the root cause of that.
Can someone fix this issue ASAP !
+1 same issue with npm 3.10.3
Happening for me as well on Windows 8.1 and npm version 3.10.9. Any updates on this?
I'm getting this on Windows 7, npm 5.0.3.
Same issue on Windows 10, npm 5.0.3
This is an npm bug, node-gyp fails to compile fsevents on Windows because it should only be installed on macOS. There is nothing node-gyp can do to fix it. optionalDependencies
shouldn't be installed on windows if they're mac specific.
@bpasero mentioned that https://github.com/npm/npm/issues/12698 might be the cause of the bug, please see that issue, or raise/find a newer one on https://github.com/npm/npm/ if there's a new issue with npm5.
Is there a work around @gibfahn ?
@bpasero mentioned that npm/npm#12698 might be the cause of the bug, please see that issue, or raise/find a newer one on https://github.com/npm/npm/ if there's a new issue with npm5.
Possible workaround run npm i --no-optional
still an issue, with latest npm
npm -v 5.6.0
AttributeError: 'MSVSProject' object has no attribute 'items'
And again a problem with node-gyp 5.0.5 in this env:
Update: Upgrading to node-gyp 6.1.0 didn't help. It still uses node-gyp 5.0.5
This workaround worked for me, and maybe useful to others, too.
Does the error message say items
or iteritems
?
The error message is:
AttributeError: 'MSVSProject' object has no attribute 'items'
Note that in the screenshot it says node-gyp 5.05. However, version 6.1.0 is installed globally....
Update: Meanwhile I cannot reproduce the problem anymore. I do not know what change made this work. I no longer need the workaround (locking fsevents to particular version) anymore either.
I have exactly same issue now. Node: 12.15.0 Npm: 6.13.4 Windows: 10
@cclauss The error message says iteritems. Here are a bunch of screenshots.
~/.npmrc
configuration filenode-gyp is v3, not v7 Node Saas is history so please use Dart Saas instead.
Wow its 2021, I'm having this now, win10
File "E:\repo\TiddlyGit-Desktop\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1827, in _DictsToFolders
for folder, contents in bucket.items():
AttributeError: 'MSVSProject' object has no attribute 'items'
× Preparing native dependencies: 0 / 1
An unhandled error has occurred inside Forge:
node-gyp failed to rebuild 'E:\repo\TiddlyGit-Desktop\node_modules\watchpack-chokidar2\node_modules\fsevents'
PS E:\repo\TiddlyGit-Desktop> npm ls fsevents
tiddly-git@0.3.6 E:\repo\TiddlyGit-Desktop
├─┬ @electron-forge/plugin-webpack@6.0.0-beta.54
│ └─┬ webpack@4.44.2
│ └─┬ watchpack@1.7.5
│ └─┬ watchpack-chokidar2@2.0.1
│ └─┬ chokidar@2.1.8
│ └── fsevents@1.2.13
└─┬ chokidar@3.5.1
└── fsevents@2.3.2
PS E:\repo\TiddlyGit-Desktop> npm ls node-gyp
tiddly-git@0.3.6 E:\repo\TiddlyGit-Desktop
└─┬ @electron-forge/cli@6.0.0-beta.54
└─┬ @electron-forge/core@6.0.0-beta.54
└─┬ electron-rebuild@2.3.4
└── node-gyp@7.1.2
PS E:\repo\TiddlyGit-Desktop> npm -v
7.6.0
PS E:\repo\TiddlyGit-Desktop> node -v
v15.11.0
npm i --no-optional
solves this
Fascinating that Windows processes are trying to install the macOS-only https://www.npmjs.com/package/fsevents
This is noted in the original post at the top of this issue.
I had the same issue as @jamietre in npm/npm#8878. Looking at the stack trace, I'm pretty sure it's node-gyp that's encountering some sort of error while trying to install fsevents (a Mac OS X-specific module, from the looks of it). The error message seems generic enough to be a gyp-related one rather than an fsevents one though, so I'm filing it here.