Node-gyp: gyp ERR! configure error during "npm ci" command run

Created on 30 Apr 2020  路  7Comments  路  Source: nodejs/node-gyp

PS E:\GitHub\discover.shared.books-admin-ui> npm ci
npm WARN prepare removing existing node_modules/ before installation

[email protected] install E:\GitHub\discover.shared.books-admin-uinode_modules\fsevents
node-gyp rebuild

E:\GitHub\discover.shared.books-admin-uinode_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin\....node_modulesnode-gyp\binnode-gyp.js" rebuild ) else (node "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gyp\binnode-gyp.js" rebuild )
Traceback (most recent call last):
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgypgyp_main.py", line 50, in
sys.exit(gyp.script_main())
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgyp\pylibgyp__init__.py", line 554, in script_main
return main(sys.argv[1:])
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgyp\pylibgyp__init__.py", line 547, in main
return gyp_main(args)
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgyp\pylibgyp__init__.py", line 532, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgyp\pylibgyp\generator\msvs.py", line 2030, in GenerateOutput
sln_projects, project_objects, flat=msvs_version.FlatSolution())
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgyp\pylibgyp\generator\msvs.py", line 1787, in _GatherSolutionFolders
return _DictsToFolders('', root, flat)
File "C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gypgyp\pylibgyp\generator\msvs.py", line 1740, in _DictsToFolders
for folder, contents in bucket.items():
AttributeError: 'MSVSProject' object has no attribute 'items'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Aliaksandr_Naidzenka\AppData\Roamingnpmnode_modulesnpmnode_modulesnode-gyp\lib\configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Aliaksandr_Naidzenka\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd E:\GitHub\discover.shared.books-admin-uinode_modules\fsevents
gyp ERR! node -v v14.0.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

Most helpful comment

There's two issues here:

  1. fsevents is macOS only. It specifies an os field in its package.json but this is apparently ignored by npm ci. fsevents used to provide prebuilt binaries up to [email protected] which meant for those versions it didn't attempt to compile. Those binaries are not provided for later versions of fsevents (e.g. 1.2.12 reported in this issue). See https://github.com/fsevents/fsevents/issues/301. This may be addressed "soonish" by a release containing https://github.com/fsevents/fsevents/pull/322.
  2. The AttributeError: 'MSVSProject' object has no attribute 'items' is probably a bug in gyp is likely something that needs to be fixed upstream (https://github.com/nodejs/gyp-next) and then synced back here.

All 7 comments

Win10 x64, node js - 14.0.0, npm - 6.14.4.
Does anybody have any idea how to fix issue with gyp?

2058

The issue occurs only during npm ci command but npm i works fine. However without npm ci command working correctly I can't do commit.
The error occurs with any of version python 3.7 or 2.7.
I've removed python 3.7 and then
I've done _Option 1
Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator)._
Now I have python 2.7 because it was installed with windows-build-tools.
And it does't work anyway.
I ran all commands in VS Code 1.44.2
From my side I don't see clearly answer in [https://github.com/nodejs/node-gyp/issues/2058]

I just started seeing this too, yesterday this wasn't happening? Was there a package update that triggered this?

I didn't add any library so there are no changes in package.json or package-lock.json. I can provide package.json and package-lock.json if necessary. Also I've tried decrease nodejs version to version 12.16.3 LTS (npm version remains the same 6.14.4) but it didn't help.

There's two issues here:

  1. fsevents is macOS only. It specifies an os field in its package.json but this is apparently ignored by npm ci. fsevents used to provide prebuilt binaries up to [email protected] which meant for those versions it didn't attempt to compile. Those binaries are not provided for later versions of fsevents (e.g. 1.2.12 reported in this issue). See https://github.com/fsevents/fsevents/issues/301. This may be addressed "soonish" by a release containing https://github.com/fsevents/fsevents/pull/322.
  2. The AttributeError: 'MSVSProject' object has no attribute 'items' is probably a bug in gyp is likely something that needs to be fixed upstream (https://github.com/nodejs/gyp-next) and then synced back here.

This is exactly the same issue as #2058. node-gyp can't possibly control what is inside binding.gyp of the modules you are trying to build.

The fsevents package is now fixed, the solution here is to update the dependencies.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sentero-esp12 picture Sentero-esp12  路  3Comments

gengjiawen picture gengjiawen  路  3Comments

andrewaustin picture andrewaustin  路  3Comments

j4y picture j4y  路  4Comments

jhermsmeier picture jhermsmeier  路  3Comments