1

I'm using yarn in windows, I've tried with: 12.13.1, *10.16.0 (Currently using 64-bit executable), 9.11.2, I get this error:

error C:\XXX\node_modules\node-expat: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\XXX\node_modules\node-expat
Output:
C:\XXX\node_modules\node-expat>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 )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Program Files (x86)\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", 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:198:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.18362
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:\XXX\node_modules\node-expat

Don't understard the messagge. I can see that the node_modules folder is created, but this happen at the end of the "linking" step of the whole process. With npm happens the same.

I've been trying: - With yarn or npm - Removing the lock files - Deleting the node_modules folder

Always the same error. Any idea?

With npm I got this messagge:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.18 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.18 install 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\paulo.miranda\AppData\Roaming\npm-cache\_logs\2020-04-02T12_32_03_383Z-debug.log
CoryCoolguy
  • 1,065
  • 8
  • 18
pmiranda
  • 7,602
  • 14
  • 72
  • 155

2 Answers2

1
 C:\Program Files (x86)\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];

Build process is trying to run python2 code (e.g. print "...") with python3 (should be print("...").

You can try to install python2 (but it is no longer supported, as of January 2020), and force installation process to run python2 instead.

Or, you can try to update your local python installation and try again.

warchantua
  • 1,154
  • 1
  • 10
  • 24
1

I just got a relatively same error at the node-gyp rebuild when I use yarn install (i assume this is the same behavior with npm install). After I scratched my head for over 10 hours, it appears that maybe what cause that is your folder name.

In my case, I use space on my folder name (ex: "John Dog"), which cause a hell of a problem but referring to this answer https://stackoverflow.com/a/33739586/14162468 I rename the folder and removed the space and voila the problem was solved. I suggest you try to change your folder name (paulo.miranda), because that . may cause error just like my case

m4n0
  • 29,823
  • 27
  • 76
  • 89