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

RFC: make node on Windows install, or prompt users to get, windows-build-tools #22311

Closed
mikemaccana opened this issue Aug 14, 2018 · 7 comments
Labels
feature request Issues that request new features to be added to Node.js. install Issues and PRs related to the installers. windows Issues and PRs related to the Windows platform.

Comments

@mikemaccana
Copy link
Contributor

mikemaccana commented Aug 14, 2018

Is your feature request related to a problem? Please describe.

Users (even experience node users like me, I'm ashamed to admit) install node for Windows on new boxes, and everything is fine installing modules for a little while until one day they need a native modules, and something seems broken. They spend a little while searching and find out they need to yarn add global windows-build-tools or npm -g install windows-build-tools

Essentially, windows-build-tools could be considered a dependency for node on Windows in the same way gcc-c++ is on Linux. As a result, it should be handled better.

Describe the solution you'd like

My gut feeling is for build tools to be installed by the node installer. Things should 'just work'.

Describe alternatives you've considered

How frequently are native modules needed? I'll let the community decide, but

  • If native modules are frequently needed, I'd like windows-build-tools to be there out of the box, in the same way that gcc-c++ is on Linux.

  • If there are some situations where local modules aren't needed, so we can't have windows-build-tools as a hard dependency, I'd like node to strongly recommend installing windows-build-tools - perhaps during compilation of native modules, perhaps after install.

I don't have any hard thoughts one way or the other, just interested in what other Windows node users have experienced here.

@addaleax addaleax added windows Issues and PRs related to the Windows platform. feature request Issues that request new features to be added to Node.js. install Issues and PRs related to the installers. labels Aug 14, 2018
@addaleax
Copy link
Member

Providing this as an optional extra install sounds like a good idea to me.

/cc @nodejs/platform-windows @felixrieseberg

@refack
Copy link
Contributor

refack commented Aug 14, 2018

Essentially, windows-build-tools could be considered a dependency for node on Windows in the same way gcc-c++ is on Linux.

AFAIK gcc in not a dependency. For example the nodesource .debs don't depend on it directly.

Aside from that windows-build-tools has some fundamental issues (licensing, maintenance, side-by-side compatibility), although it does have many benefits. As such I believe only Microsoft can provide a full solution, similar to what they did for Python2.7, a.k.a Microsoft Visual C++ Compiler for Python 2.7.

So IMHO keeping it as an opt-in recommendation is still the optimal option - https://github.com/nodejs/node-gyp#on-windows

@refack
Copy link
Contributor

refack commented Aug 14, 2018

P.S. running npm install scrypt on a vanilla ubuntu (with just node 10.8) gives a similar obscure error:

ubuntu@ip-172-30-0-137:~/node-v10.8.0-linux-x64/bin$ npm install scrypt

> [email protected] preinstall /home/ubuntu/node-v10.8.0-linux-x64/bin/node_modules/scrypt
> node node-scrypt-preinstall.js

Error: Error: Command failed: ./configure
configure: error: in `/home/ubuntu/node-v10.8.0-linux-x64/bin/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details


> [email protected] install /home/ubuntu/node-v10.8.0-linux-x64/bin/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-1061-aws
gyp ERR! command "/home/ubuntu/node-v10.8.0-linux-x64/bin/node" "/home/ubuntu/node-v10.8.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/node-v10.8.0-linux-x64/bin/node_modules/scrypt
gyp ERR! node -v v10.8.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/ubuntu/node-v10.8.0-linux-x64/bin/package.json'
npm WARN bin No description
npm WARN bin No repository field.
npm WARN bin No README data
npm WARN bin No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     /home/ubuntu/.npm/_logs/2018-08-14T16_44_00_058Z-debug.log

@mikemaccana
Copy link
Contributor Author

mikemaccana commented Aug 17, 2018

Thanks @refack. Do you think the message produced by nodesource debs to could be a good example?

 ## You may also need development tools to build native addons:
 sudo apt-get install gcc g++ make

I could imagine the windows installer providing similar advice to install windows-build-tools at the end of the process would fix a lot of these cases. As you've mentioned, the docs already ask people to do this.

@refack
Copy link
Contributor

refack commented Aug 17, 2018

I could imagine the windows installer providing similar advice to install windows-build-tools at the end of the process would fix a lot of these cases.

That does sound like a good idea.
Let's see if anyone in @nodejs/platform-windows (@jdalton who revealed himself as Windows adjacent) has the skill and bandwidth to follow up.

@joaocgreis
Copy link
Member

PR: #22645

@mikemaccana
Copy link
Contributor Author

mikemaccana commented Sep 12, 2018 via email

targos pushed a commit that referenced this issue Sep 12, 2018
Add a dialog during installation with information about native
modules that can optionally run a Boxstarter script at the end of the
installation. This script can also be run from Start menu.

Fixes: #22311
PR-URL: #22645
Reviewed-By: Richard Lau <[email protected]>
targos pushed a commit that referenced this issue Sep 27, 2018
Add a dialog during installation with information about native
modules that can optionally run a Boxstarter script at the end of the
installation. This script can also be run from Start menu.

Fixes: #22311
PR-URL: #22645
Reviewed-By: Richard Lau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. install Issues and PRs related to the installers. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants