-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
electron-rebuild failed with syntax errors #2194
Comments
I have same problem when compile serialport@9.0.4 with electron V11 .When I downgrade electron to V9, it works, |
Based on the error messages, I think this may be use to the use of Python 2. The docs have since been updated to correctly reflect the use of python 3. This should now work with Electron 11-13; but if you are still facing any issues then please let me know |
@GazHank im getting this same error in an electron project of mine, but i am fairly sure i have gyp pointing to the correct python (3) i have my .npmrc set with the correct python:
and i also tried setting the PYTHON environment variable to my python3 exe, but no luck. here is the output of my electron-rebuild (npm install completed successfully without error)
Any help or suggestions of where to look would be much appreciated |
im wondering if because of this log:
that somehow it is using the 2015 version of VS build tools when i have it explicitly set in my .npmrc to use 2019 |
are you still facing issues with #2299 or am I seeing your comments out of sequence? If updating to VS2017 / 2019 worked per your comments on #2299 then it looks like this could be the fix needed (in combination with updating to python 3) ps - at the moment the node-serialport docs have links to sources such as node-gyp and electron-rebuild in part so that if they change their dependencies it doesnt render the doc out of date. However given a few people are hitting this sort of issue, I wonder if it would be better for everyone if we just included the info rather than a link. @reconbot do you have a preference for how you would like to handle this? Could the new discussions functionality in github help this sort of troubleshooting? |
sorry Gaz, this is a different electron project than electron-rebuild. i was hitting errors just trying to build the sample project, but that was resolved in #2299, and im now seeing this separate error building a separate app (but same versions of electron, serialport, and electron-rebuild). i am using the exact same system that successfully built electron-serialport (python3, and msvs 2019) so not sure why it isnt liking my project when it happily built electron-serialport. |
i uninstalled my 2015 ms build tools install and am now getting the following error:
from the output it looks like electron-rebuild isnt finding my 2019 or 2017 visual studio installs somehow, even though it can install/rebuild electron-serialport just fine..... |
I know this isn't ideal, but could you try using the "visual studio command prompt" to see if that solves this issue? if this works then it would be because your environment variables arent setup . I can help you set those up, but I want to make sure that is the root cause first. Unfortunately MS VS stopped updating the environment variables in recent version in an attempt to allow you to have multiple build tool versions on a single machine without conflict. |
it doesnt seem to have made a difference:
here is my .npmrc right now (excluding some certs):
the msbuild_path was something i was trying from this thread: nodejs/node-gyp#1753 |
how about if you clear the MSbuild and msvs version info from the .npmrc and try the VS command prompt? |
exact same result. it still thinks i am setting msvs_version somehow
|
im also working on getting a clean windows vm install so i can try from a slightly less janky windows install |
that sounds like a sound plan :-) in the meantime you could try |
here is full config (minus private npm info which i redacted):
i dont see anything referencing msvs_version |
🤞🏼 |
Success! it was able to re-build serialport, but then died while re-building the native xml library i use lol |
that's good news (I think?) @orange-beans and @hustzju please let us know if updating to python 3 and VS build tools 2017+ help resolve this for you too? @gunnarSensus I'm not sure I can help, but feel free to @ me in your issue/ investigation into the native xml library issue, I'd be happy to try to help if I can |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a |
Summary of Problem
Running electron-rebuild for serialport module failed. And lots of syntax errors appears in the error message.
Code to Reproduce the Issue
Versions, Operating System and Hardware
The text was updated successfully, but these errors were encountered: