Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

npm ERR! Failed at the [email protected] install script 'electron-rebuild'. #252

Closed
yilunyu opened this issue Jan 14, 2017 · 1 comment
Closed

Comments

@yilunyu
Copy link

yilunyu commented Jan 14, 2017

I am using the boilerplate as a place to start off my first electron project. I am using a Windows 7. running npm install on the original electron-boilerplate is completely fine. I made some changes to the boilerplate project so that it could communicate with the serial port. I added serialport and vendor to package.json so that it looks like:

"dependencies": {
"fs-jetpack": "^0.10.2",
"serialport": "^4.0.7"
}
"build": {
"appId": "com.example.electron-boilerplate",
"files": [
"app//*",
"node_modules/
/*",
"package.json",
"vendor"
]
}

Doing this initially gave me
gyp ERR! configure error
gyp ERR! stack error: can't find Python executable "python" ...

I installed the newest python 2 and the first problem went away. Now it is giving me this error:

An unhandled error occurred inside electron-rebuild
C:\Users\yu\projects\electron-boilerplate2\cesller-phone\node_modules\serialport
\build\binding.sln : error MSB3411: Could not load the Visual C++ component "VCB
uild.exe". If the component is not installed, either 1) install the Microsoft Wi
ndows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsof
t Visual Studio 2008.
...

I do not wish to install these. Why did this problem not occur on the original boilerplate project when electron-rebuild is listed as a devDependency? Is there a way to bypass electron-rebuild or solve this without installing all of those things recommended? I tried just running npm install --production, since electron-rebuild is only a devDependency, but it gave me the same error.

@szwacz
Copy link
Owner

szwacz commented Jan 14, 2017

electron-rebuild is the thing you need to rebuild native module for electron (when you did npm install it was built for your locally installed node.js). So the problem is that serialportgives trouble when rebuilding. I seen people in the past having trouble with this library and, there is whole topic about it: serialport/node-serialport#538

So probably you'll need to do some googling and hacking to have serialport installed.

@szwacz szwacz closed this as completed Jan 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants