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

Errors building project with yarn, cannot resolve dependencies? #2

Closed
rgobo opened this issue May 26, 2020 · 3 comments
Closed

Errors building project with yarn, cannot resolve dependencies? #2

rgobo opened this issue May 26, 2020 · 3 comments

Comments

@rgobo
Copy link

rgobo commented May 26, 2020

Building on windows 10, I installed yarn with the installer from the official site (version 1.22.4)
When I move to the overlay folder and run "yarn install", I get the following output:

$ yarn install
yarn install v1.22.4
warning package.json: No license field
warning data-core@0.0.1: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.12: The platform "win32" is incompatible with this module.
info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/6] ⡀ iohook
[2/6] ⡀ robotjs
[3/6] ⢀ windows-foreground-love
[4/6] ⢀ electron
error C:\dev\Projects\GW2 Data Pad\gw2-data-pad\overlay\node_modules\windows-foreground-love: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\dev\Projects\GW2 Data Pad\gw2-data-pad\overlay\node_modules\windows-foreground-love
Output:
C:\dev\Projects\GW2 Data Pad\gw2-data-pad\overlay\node_modules\windows-foreground-love>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.15.3 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\username\AppData\Local\Programs\Python\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:189:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:970: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:\dev\Projects\GW2 Data Pad\gw2-data-pad\overlay\node_modules\windows-foreground-love

I'm not that familiar with yarn so I don't know if it should handle all dependencies or if I need some stuff installed on my own. It looks like maybe the python version is not compatible? In any case, just dropping a report here, maybe someone else got it as well.

@nminchow
Copy link
Owner

I don't suspect that this is an issue with yarn. More probably a python version issue, possibly triggered by an old npm version. Are you running python 3.7.x locally? Can you try an npm upgrade? npm i npm -g

@rgobo
Copy link
Author

rgobo commented May 28, 2020

python -V says I'm running 3.7.1

I ran npm i npm -g as you said, it updated a bunch of packages. npm -v says its current version is 6.14.5.

I went back to the overlay folder, ran yarn install again but got the same error:

AppData\Local\Programs\Python\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];

After some more googling, it seems like this is a node-gpy issue - it needs python 2.7 to run despite the requirements saying newer versions will work.

nodejs/node-gyp#1268

nodejs/node-gyp#1825

I'm not really interested in downgrading so I won't be trying this fix though... but at least good to know I guess.

@rgobo rgobo closed this as completed May 28, 2020
@nminchow
Copy link
Owner

Yeah, I had seen those as well, that was the impetus for my first question, but this thread indicates that a newer versions of gyp should work with newer python: nodejs/node-gyp#1977.

If you want to give this one more shot, it might be worth nuking your local node_modules and trying a fresh install. It looks like you should be getting a new enough version of gyp.

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

2 participants