-
Notifications
You must be signed in to change notification settings - Fork 2k
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
node-check-version.js breaks on new NPM installs #3048
Comments
Thanks for bringing this to our attention, @Pomax! I honestly did not know about the About the changed hardcoded path - which version of BTW, we are doing it via script like this because we want to check for a "sane" version of npm, before starting to |
the Better to assume people have an up to date node, and have them deal with the problem of using outdated versions, then having the install process break for people due to the hardcoded location not being a valid fs location, right? |
More discussion about this at https://github.com/Automattic/wp-calypso/pull/2124/files#r54121505. Summarizing a bit, we want to run this quick check before
Can you provide more details about this? Is there a version of Node.js / npm that no longer contains semver in the expected location? |
Node does not come with semver; it's an external package managed through the npm registry. It might be that some linux distros come with a bundle of some handy packages when you install it through their package managers, or run a post-install for node that makes npm install a set of useful packages, but if you install the official Node from https://nodejs.org, or you install it through brew on OSX or using the official Node.js This should be relatively easy to take care of with a
This will run as part of an
and users will only need to type |
In every Node.js install I have ever seen, npm is included, and npm depends on semver, so semver is installed. This includes I'm surprised to hear that there are situations where this isn't true, and I'd like more details about how to reproduce that condition. |
Then all I can tell you is that these are all regular node.js installs on several OSX and Windows machines. We clone the calypso project, we run the make script, things die when we hit If I run Node 5.6 on, for instance, windows 7 x64, in a dir without any npm modules installed,
It's entirely possible that npm relies on a local copy of semver, nested in "wherever it lives", in accordance with the NPM3 way of module management. I don't know. All I know is that if you install Node.js through official channels, |
As seen in the Makefile, we search for the
Can you please add an
That's the path where we expect |
I can try to, although I'm still going to recommend not "looking for where the module lives" -that information should be black box information- but just relying on npm being able to do the right thing here: it is really easy to bootstrap the It'll just work. Hook it up as |
As an aside, a quick check on Debian 8 with Node 5.6 shows the same as windows:
|
That's correct - that's why we use an absolute path (the |
As a cross-platform advocate, I highly recommend making |
It looks like "spaces in file names" is biting us here; at least on Windows, Node and NPM install themselves in the Definitely worth asking npm to handle this. (No access to an OSX machine atm, I've asked a colleague who ran into this on OSX whether they can check what their |
It does seem cleaner to do I bet this check isn't the only thing that fails when paths have spaces in them, though. From the Windows install instructions:
|
yeah that's not really an option for people who actually work with windows setups, though, unless you have the money to buy separate licenses for different concurrent setups =( Git, node, etc. all have normal installers that respect Windows' rules on where applications go, for instance, so as good Windows citizens they're going to live in a path with spaces, like every other application. You'd really need a separate install or WinVM for ntentionally installing everything in complete the wrong places, so instructions like these offer Windows support in the same way that a Windows OSS project could note that things are super easy to setup on Windows, and on unix you "just have to make sure to install everything in Fixing the semver requirement (despite there being a few more places where spaces in paths might be a problem I understand from previous comments/comments in the PR?) seems to take running the project a long way, so I'll file a PR this weekend, when I have time to look at how much of the make process can actually be done by npm scripts. |
Closing as no action in several months — feel free to re-open once a pull request is submitted to change things. |
The particular problem here was fixed in #4002. Any further problems with the build process should get their own specific issue. |
wp-calypso/bin/check-node-version
Line 3 in 66126f3
with the
semver
package in the devDependencies list.Although the job this is doing can be done entirely without semver, by simply putting an
engines
section in the package.json that says which node version is required for this software to run. No need forcheck-node-version
with that in place.The text was updated successfully, but these errors were encountered: