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

Error to build N1 in Windows 10 with Visual Studio 2015 #2749

Closed
khoaho opened this issue Aug 22, 2016 · 10 comments
Closed

Error to build N1 in Windows 10 with Visual Studio 2015 #2749

khoaho opened this issue Aug 22, 2016 · 10 comments

Comments

@khoaho
Copy link

khoaho commented Aug 22, 2016

Hi,

I follow the instruction at https://github.com/nylas/N1/blob/master/docs/Windows.md to build N1 in Windows 10 with Visual Studio 2015. However, there is an error that I still don't know how to fix. My node-gyp version is 3.4.0.

C:\Data\GitHub\N1\script>bootstrap.cmd
Node: v6.3.1
npm: v3.10.3
Python: v2.7.11
---> Installing N1 build tools
This goes inside the build folder and runs npm install
It will use the system npm to bootstrap our own N1 npm.
Our build tools (like Grunt) need to be compiled against Node via npm.
Everything else needs to be compiled against Chromium with apm.
$ npm --userconfig="C:\Data\GitHub\N1\script.npmrc" install --loglevel error --cwd="C:\Data\GitHub\N1\build" --ignoreStdout=true
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
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:\Data\GitHub\N1\node_modules\runas
gyp ERR! node -v v6.3.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "--userconfig=C:\Data\GitHub\N1\script.npmrc" "install" "--loglevel" "error"
npm ERR! node v6.3.1
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! runas@3.1.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the runas@3.1.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the runas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs runas
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls runas
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Data\GitHub\N1\build\npm-debug.log
npm ERR! code 1

Thank you.

@khoaho
Copy link
Author

khoaho commented Aug 23, 2016

I also got errors on build in Ubuntu 16 LTS:

khoa@ubuntu:~/dev/github/N1$ script/bootstrap
Node: v4.2.6
npm: v3.5.2
---> Installing N1 build tools
This goes inside the build folder and runs npm install
It will use the system npm to bootstrap our own N1 npm.
Our build tools (like Grunt) need to be compiled against Node via npm.
Everything else needs to be compiled against Chromium with apm.
$ npm --userconfig="/home/khoa/dev/github/N1/.npmrc" install --loglevel error --cwd="/home/khoa/dev/github/N1/build" --ignoreStdout=true
Ignoring node_modules, which is missing.
Running "add-nylas-build-resources" task
No extra Nylas resources added
Done, without errors.
---> Installing apm
This installs apm via N1's npm
We use this local apm copy to install all N1 dependencies & packages
$ "/home/khoa/dev/github/N1/build/node_modules/.bin/npm" --userconfig="/home/khoa/dev/github/N1/.npmrc" --target=0.10.40 install --loglevel error --cwd="/home/khoa/dev/github/N1/apm" --ignoreStdout=true
Package gnome-keyring-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing gnome-keyring-1.pc' to the PKG_CONFIG_PATH environment variable No package 'gnome-keyring-1' found gyp: Call to 'pkg-config --libs-only-l gnome-keyring-1' returned exit status 1. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error:gypfailed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/home/khoa/dev/github/N1/build/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 4.4.0-21-generic gyp ERR! command "/usr/bin/nodejs" "/home/khoa/dev/github/N1/build/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/khoa/dev/github/N1/apm/node_modules/keytar gyp ERR! node -v v4.2.6 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm ERR! Linux 4.4.0-21-generic npm ERR! argv "/usr/bin/nodejs" "/home/khoa/dev/github/N1/build/node_modules/.bin/npm" "--userconfig=/home/khoa/dev/github/N1/.npmrc" "--target=0.10.40" "install" "--loglevel" "error" npm ERR! node v4.2.6 npm ERR! npm v3.3.10 npm ERR! code ELIFECYCLE npm ERR! keytar@3.0.2 install:node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@3.0.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the keytar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls keytar
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/khoa/dev/github/N1/apm/npm-debug.log

Thank you.

@starmate
Copy link

Hi,

I am facing the exact same issue while trying to compile on Windows 10 with Visual Studio 2015.

Did you find a solution?

Thanks,

Jon

@khoaho
Copy link
Author

khoaho commented Sep 22, 2016

Hi Jon,

I still have this same issue on Windows 10 again with the latest code. I tested this project in Cloud9 which uses Linux and still see the issue in Ubuntu. It seems to be the problem with node-gyp version being used with node/npm in Windows but I don't go further for the solution.

-Khoa

@starmate
Copy link

Hi Khoa,

Thanks for the information. node-gyp is not able to be recompiled and whatever the version of Node used or version of Visual studio, it gives the same results.

I tried everything and really don't know how to fix this. If someone has an idea...

Jon

@bengotow
Copy link
Contributor

bengotow commented Oct 12, 2016

Hey folks! Unfortunately we have a few native node modules that don't seem to build correctly with VS 2015. Our team uses VS 2013 to build N1, along with Node 4.2. Could you try using those? I believe you can run npm config set msvs_version 2013 so node-gyp defaults to using VS2013 once you've installed it.

If you previously had problems building, you may have half-built or incorrectly-built node modules inside the project directory that don't get rebuilt. You can reset your working copy with git clean -xdf so script/bootstrap runs from scratch. Can you try that and let me know if you still have trouble?

Sorry, Windows is definitely the hardest platform to build Node projects on, and we have so many native node modules that we depend on, it's sort of a battle to get them all compiling happily.

@khoaho
Copy link
Author

khoaho commented Oct 13, 2016

Thank you @bengotow . I follow your instruction to install and use Node 4.2 with VS 2013. It comes better not to show the error of using VS 2015 but it get another error of strip-json-comments. Here is the script I used with the error at the end.

nvm install 4.2
nvm use 4.2
git pull
git clean -xdf
npm config set msvs_version 2013 --global (without global not work)
script\bootstrap.cmd

C:\Data\GitHub\N1>script\bootstrap.cmd
Node: v4.2.0
npm: v3.3.10
Python: v2.7.11
---> Installing N1 build tools
This goes inside the build folder and runs npm install
It will use the system npm to bootstrap our own N1 npm.
Our build tools (like Grunt) need to be compiled against Node via npm.
Everything else needs to be compiled against Chromium with apm.
$ npm --userconfig="C:\Data\GitHub\N1.npmrc" install --loglevel error --cwd="C:\Data\GitHub\N1\build" --ignoreStdout=true
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "--userconfig=C:\Data\GitHub\N1.npmrc" "install" "--loglevel" "error"
npm ERR! node v4.2.0
npm ERR! npm v2.14.7
npm ERR! file C:\Users\Khoa\AppData\Roaming\npm-cache\strip-json-comments\1.0.4\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\Khoa\AppData\Roaming\npm-cache\strip-json-comments\1.0.4\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! C:\Data\GitHub\N1\build\npm-debug.log

@starmate
Copy link

Hi bengotow,

I've just tried with Visual Studio 2013 and I also removed Visual Studio 2015, but here is the result:

C:\Nylas1\N1>script\bootstrap.cmd
Node: v4.2.0
npm: v2.14.7
Python: v2.7.12

---> Installing N1 build tools
This goes inside the build folder and runs npm install
It will use the system npm to bootstrap our own N1 npm.
Our build tools (like Grunt) need to be compiled against Node via npm.
Everything else needs to be compiled against Chromium with apm.

 $ npm --userconfig="C:\Nylas1\N1\.npmrc" install --loglevel error --cwd="C:\\Nylas1\\N1\\build" --ignoreStdout=true

Ignoring node_modules, which is missing.
Running "add-nylas-build-resources" task
No extra Nylas resources added

Done, without errors.

---> Installing apm
This installs apm via N1's npm
We use this local apm copy to install all N1 dependencies & packages

 $ "C:\Nylas1\N1\build\node_modules\.bin\npm" --userconfig="C:\Nylas1\N1\.npmrc" --target=0.10.40 install --loglevel error --cwd="C:\\Nylas1\\N1\\apm" --ignoreStdout=true

gyp ERR! build error
gyp ERR! stack Error: msbuild failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Nylas1\N1\build\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Nylas1\N1\build\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Nylas1\N1\apm\node_modules\keytar
gyp ERR! node -v v4.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Nylas1\N1\build\node_modules\npm\bin\npm-cli.js" "--userconfig=C:\Nylas1\N1.npmrc" "--target=0.10.40" "install" "--loglevel" "error"
npm ERR! node v4.2.0
npm ERR! npm v3.3.10
npm ERR! code ELIFECYCLE

npm ERR! keytar@3.0.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@3.0.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the keytar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls keytar
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Nylas1\N1\apm\npm-debug.log

Do you have any other suggestions?

Thanks

@khoaho
Copy link
Author

khoaho commented Oct 16, 2016

I had a better result to fix my previous errors (in Windows 10). Here are my steps:

Delete npm-cache folder at %AppData%\npm-cache
Install latest node.js (version 6.8.1 at this time)

nvm install 6.8.1
nvm use 6.8.1
git pull
git clean -xdf
npm config set msvs_version 2013 --global
npm install
script\bootstrap.cmd

Here is the new error log. I hope it comes closer to success:

C:\Data\GitHub\N1>script\bootstrap.cmd
Node: v6.8.1
npm: v3.3.10
Python: v2.7.11
---> Installing N1 build tools
This goes inside the build folder and runs npm install
It will use the system npm to bootstrap our own N1 npm.
Our build tools (like Grunt) need to be compiled against Node via npm.
Everything else needs to be compiled against Chromium with apm.
$ npm --userconfig="C:\Data\GitHub\N1.npmrc" install --loglevel error --cwd="C:\Data\GitHub\N1\build" --ignoreStdout=true
Warning: Task "add-nylas-build-resources" not found. Use --force to continue.
Aborted due to warnings.

I don't know which code to modify in script\boostrap to fix this error.

@starmate
Copy link

starmate commented Oct 19, 2016

Hi,

I was finally able to build Nylas Under Windows 10 with visual studio 2013!
Here is the process:

  • remove any other Visual studio versions
  • remove any other build Tools
  • install visual studio 2013 if it is not the case

And use the following commands:

  • nvm install 4.2
  • nvm use 4.2
  • git pull
  • git clean -xdf
  • set GYP_MSVS_VERSION=2013
  • npm install --msvs_version=2013
  • script\bootstrap.cmd
  • electron\electron.exe . --dev

The problem was linked to the fact that compiler was trying to use installed build Tools (Platform Toolset = 'v140') and was generating issues during compilation process. Now everything works well!

I hope that this will help anyone having the same issue.

Jon

@bengotow
Copy link
Contributor

Hey that's great! Glad you got it working - I haven't run into the build tools issue before. Good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants