Commit Graph

14 Commits

Author SHA1 Message Date
Ben Newman
acc98c7c15 Set NPM_CONFIG_PREFIX to dev_bundle by default. 2016-11-02 19:23:09 -04:00
Ben Newman
50528819cf Change terminology from METEOR_UNSAFE_PERM to METEOR_ALLOW_SUPERUSER.
The --unsafe-perm option is still supported but no longer advertised.
2016-10-28 16:11:29 -04:00
Ben Newman
e4acc36f63 Respect METEOR_UNSAFE_PERM in addition to --unsafe-perm.
This is important for `meteor npm`, since we don't parse or pass through
Meteor-specific command-line arguments when running `meteor npm`.

When METEOR_UNSAFE_PERM is set, its value is now propagated to any npm
commands via the NPM_CONFIG_UNSAFE_PERM variable.

Helps with #7959.
Follow-up to #7821.
2016-10-28 16:11:29 -04:00
Ben Newman
4300d261f3 Support meteor <command> for any dev_bundle/bin/<command> executable.
This will make it easier to use tools like https://yarnpkg.com/ with the
right version of Node, etc.

With this commit, here's all you have to do:

  meteor npm install -g yarnpkg

Then test that it works:

  meteor yarn info

Note that any commands registered by Meteor itself will not be honored.
2016-10-12 13:22:26 -04:00
Ben Newman
3313180a6f Always use dev_bundle/.npm as the cache for meteor npm ... commands.
I believe a strange interaction with the global cache (~/.npm on Unix
systems) may have been the root cause of the problem fixed by this commit:
https://github.com/meteor/meteor/pull/7668/commits/ad61a935146c34e7
2016-09-21 18:53:33 -04:00
Ben Newman
4bdc65919d Set $USERPROFILE to the dev bundle directory for meteor {node,npm}.
The node-gyp tool uses `process.env.HOME || process.env.USERPROFILE` to
determine where it should install the .node-gyp directory containing Node
headers and libraries, and we now preinstall that directory at
dev_bundle/.node-gyp/, so (with this change) no download should be
necessary.
2016-08-06 13:46:16 -04:00
Ben Newman
39851fc6b0 Use known dev_bundle path for internal npm commands. 2016-07-17 21:26:53 -04:00
Ben Newman
4e2615e3fc Use Buffer.concat instead of joining strings. 2016-07-17 13:08:37 -04:00
Ben Newman
0f49be5973 Don't pass custom env to python.exe in addWindowsVariables.
The env isn't necessary, and it seems to cause problems running python.exe
in some Windows environments.
2016-07-15 16:27:46 -04:00
Ben Newman
578d40a753 Use node-gyp to infer GYP_MSVS_VERSION when possible.
As a refinement of my previous commit, we will continue setting the
$GYP_MSVS_VERSION variable to "2015" except in cases where the Python
library behind node-gyp succeeds in inferring the correct version.

Note that the Python library will never infer "2015" by itself, even
though that's the version recommended by the node-gyp setup instructions:

  https://github.com/nodejs/node-gyp#installation.

Note also that the Windows machines used by `meteor admin get-machine` and
build.meteor.com have version "2010e", which can be inferred.

In other words, this commit allows the following groups of developers to
avoid setting $GYP_MSVS_VERSION manually:

  1. Developers who followed the node-gyp setup instructions.
  2. Package authors who run `meteor publish-for-arch` on build machines.
2016-07-15 15:57:31 -04:00
Ben Newman
3c06050a25 Stop setting process.env.GYP_MSVS_VERSION for meteor npm.
Setting GYP_MSVS_VERSION to 2015 when the Visual C++ 2015 build tools are
not (and/or cannot be) installed is (in my experience) the leading cause
of `npm rebuild` failures on older Windows machines.

Auto-detecting the appropriate version is something node-gyp ought to be
able to do as well as Meteor possibly could, at least according to
https://github.com/nodejs/node-gyp/blob/1dcf356ca7/gyp/pylib/gyp/MSVSVersion.py#L222-L223

When selecting a different version is important, you can always set the
GYP_MSVS_VERSION environment variable yourself. Specifically, if you're a
package author, and your package depends on npm packages that can only be
compiled with a newer version of MSBuild.exe, then you might need to run

  $env:GYP_MSVS_VERSION = "2015"
  meteor publish-for-arch name:package@x.y.z

I fully trust that the folks in that small category can handle that
additional burden.
2016-07-15 12:42:49 -04:00
Ben Newman
f812762353 Infer dev_bundle for meteor {npm,node} from .meteor/release.
Fixes #7338.
Fixes #7297.
2016-07-06 21:00:40 -04:00
Ben Newman
fdce895bba Make sure env.Path === env.PATH on Windows. 2016-05-16 18:21:09 -04:00
Ben Newman
d060ae9a2d Decompose a helper for cloning process.env for npm-related commands. 2016-05-16 18:21:09 -04:00