You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
207 lines
11 KiB
Plaintext
207 lines
11 KiB
Plaintext
solution-viewer
|
|
.solutions(show="{solution != null && solution !== false}")
|
|
h2 This is probably your problem:
|
|
|
|
solution(topic="bindingSyntax")
|
|
h3 There's a syntax error in the <code>binding.gyp</code> file of the <code>{parent.offendingModule}</code> module.
|
|
p Unfortunately, there's nothing you can do about this, other than filing a bug on the <code>{parent.offendingModule}</code> package and waiting for the author to fix it.
|
|
|
|
solution(topic="missingEnvironment")
|
|
h3 Your build environment is missing or incomplete.
|
|
p One or more build tools or SDKs are missing from your system. Follow the <a href="https://github.com/nodejs/node-gyp#installation">setup instructions for <code>node-gyp</code></a> to resolve this.
|
|
|
|
solution(topic="brokenEnvironment")
|
|
h3 Your build environment is broken.
|
|
p Something in your environment doesn't work as it should; it's possible that you're missing some build tools, or that they need to be updated or rebuilt.
|
|
p Try the following steps:
|
|
|
|
ol
|
|
li Follow the <a href="https://github.com/nodejs/node-gyp#installation">setup instructions for <code>node-gyp</code></a>.
|
|
li If on OS X, make sure to upgrade your installation of XCode to the latest version.
|
|
li If it still doesn't work, try reinstalling Node.js.
|
|
|
|
solution(topic="missingPython")
|
|
h3 Python is not installed.
|
|
p You will need to have Python installed, to be able to install compiled (C++) modules with NPM. It's possible that you're also missing other build tools.
|
|
p To solve this problem, follow the <a href="https://github.com/nodejs/node-gyp#installation">setup instructions for <code>node-gyp</code></a>.
|
|
|
|
solution(topic="wrongPython")
|
|
h3 You have the wrong version of Python installed.
|
|
p The <code>node-gyp</code> utility, which is used for installing compiled (C++) modules with NPM, only supports Python 2. However, you only seem to have Python 3 installed.
|
|
p To solve this problem, follow the <a href="https://github.com/nodejs/node-gyp#installation">setup instructions for <code>node-gyp</code></a>.
|
|
p If you're certain that you have Python 2 installed, you may need to configure <code>npm</code> to know where it is. This is also covered in the above instructions.
|
|
|
|
solution(topic="gcc")
|
|
h3 Your C++ compiler is too old.
|
|
p Newer C++ modules for Node.js require a recent C++ compiler, and not all distributions include a recent enough version of GCC.
|
|
p The exact instructions will vary by distribution and OS, but these are some that I know of:
|
|
|
|
ul
|
|
li: a(href="http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/") Ubuntu
|
|
|
|
p If you know of instructions for other distributions, then please <a href="mailto:admin@cryto.net">send me an e-mail!</a>
|
|
|
|
solution(topic="nan")
|
|
h3 Your version of Node.js is too new, and you need to update your dependencies.
|
|
p The version of the <code>{parent.offendingModule}</code> module that you're trying to install, was written for an older Node.js version. There's probably a newer version available, so try updating your project or its dependencies.
|
|
p If this doesn't work, then file a bug on the <code>{parent.offendingModule}</code> module, and ask the author to make it compatible with the newest Node.js version.
|
|
|
|
solution(topic="v8")
|
|
h3 Your version of Node.js is either too new, or too old.
|
|
p The version of the <code>{parent.offendingModule}</code> module that you're trying to install, was written for a different Node.js version.
|
|
p There may be a different version available that's compatible with your Node.js version.
|
|
p If there isn't, or you can't find it, then file a bug on the <code>{parent.offendingModule}</code> module, and ask the author to make it compatible with the newest Node.js version.
|
|
|
|
solution(topic="missingLibrary", data-handler="{_missingLibraryHandler}")
|
|
h3 You're missing one or more libraries on your system.
|
|
p A dependency you're trying to install (<code>{parent.offendingModule}</code>) requires one or more libraries to be installed on your system, but NPM can't find them.
|
|
p The missing libraries are:
|
|
|
|
.libraryBoxes
|
|
library-box(each="{library in parent.missingLibraries}", library-info="{library}")
|
|
.clear
|
|
|
|
virtual(if="{parent.hasUnknownLibraries}")
|
|
p For the unknown libraries listed above, try reading the documentation of the <code>{parent.offendingModule}</code> module, or Googling the filename(s).
|
|
p To help improve this tool, please <a href="mailto:admin@cryto.net">e-mail me</a> with the details once you've determined which package(s) the libraries belong to, and I'll add them to the database.
|
|
|
|
solution(topic="libraryVersion")
|
|
h3 You have the wrong version of a library installed on your system.
|
|
p One or more of the libraries that's used by the <code>{parent.offendingModule}</code> module exist on your system, but aren't the right version.
|
|
p Unfortunately I don't really have more information about it - you'll have to read the documentation for the <code>{parent.offendingModule}</code> module to determine which version you need to have installed.
|
|
p Alternatively, you can <a href="mailto:admin@cryto.net">e-mail me</a> with a <a href="https://gist.github.com/">gist</a> of your NPM output, and I'll try to find the problem for you.
|
|
|
|
solution(topic="headers")
|
|
h3 You're missing the Node.js development headers.
|
|
p When installing Node.js from your distribution's package manager, you must also install the development headers. Some possible names of the package for this:
|
|
ul
|
|
li: code node-dev
|
|
li: code node-devel
|
|
li: code nodejs-dev
|
|
li: code nodejs-devel
|
|
p Depending on the distribution you're using, it may also have a different name.
|
|
|
|
solution(topic="npmBug")
|
|
h3 That looks like an NPM bug.
|
|
p Occasionally, NPM installations will bug out, and it seems like that has happened here. Try removing your <code>node_modules</code> directory, and installing your dependencies again from scratch using <code>npm install</code>.
|
|
p Make sure that your <code>package.json</code> correctly declares all your dependencies, or there might be missing dependencies. <a href="https://gist.github.com/joepie91/9b9dbd8c9ac3b55a65b2#installing-a-package">This article</a> explains how to install packages in such a way that this is never an issue.
|
|
|
|
solution(topic="symlinkIssue")
|
|
h3 There's an issue with symbolic links on your system.
|
|
p You are most likely running <code>npm install</code> in something like Docker or VirtualBox, with "shared directories" enabled. This is known to cause issues with symbolic links on some platforms.
|
|
p A <a href="https://forums.docker.com/t/npm-install-doesnt-complete-inside-docker-container/12640/34">workaround</a> is to install your packages using <code>--no-bin-links</code>.
|
|
|
|
solution(topic="unmetDependency", data-handler="{_missingModuleHandler}")
|
|
h3 You're missing a dependency.
|
|
p Your <code>package.json</code> indicates a dependency that isn't actually installed into your <code>node_modules</code>. These are the dependencies you're missing:
|
|
|
|
.moduleBoxes
|
|
module-box(each="{module in parent.missingModules}", module-info="{module}")
|
|
.clear
|
|
|
|
p You can generally fix this by simply running <code>npm install</code>, without any additional arguments.
|
|
|
|
solution(topic="unmetPeerDependency", data-handler="{_missingModuleHandler}")
|
|
h3 You're missing a peer dependency.
|
|
p You're missing one or more dependencies that require manual installation - usually, this concerns a library that you've installed a plugin for. The missing dependencies are:
|
|
|
|
.moduleBoxes
|
|
module-box(each="{module in parent.missingModules}", module-info="{module}")
|
|
.clear
|
|
|
|
p To understand the range notation that is used here (if any), read <a href="https://gist.github.com/joepie91/9b9dbd8c9ac3b55a65b2#semantic-versioning">this article</a>.
|
|
|
|
h2 Did this solve your problem?
|
|
|
|
p Maintaining open-source projects takes a lot of time and effort. If this tool saved you some headaches, consider <a href="http://cryto.net/~joepie91/donate.html">making a donation</a> :)
|
|
|
|
h2 Still broken?
|
|
|
|
p If it still doesn't work, please <a href="https://git.cryto.net/joepie91/why-is-npm-broken/issues/new">file an issue</a>, containing the full <code>npm install</code> output.
|
|
|
|
//p If it still doesn't work, contact me and I'll try to work out what's wrong. Please paste your output to a pastebin like <a href="https://gist.github.com/">GitHub Gist</a>, and send it to me on IRC or by e-mail.
|
|
|
|
//p <strong>IRC:</strong> You can find me on Freenode in #Node.js as <em>joepie91</em>.
|
|
|
|
//p <strong>E-mail:</strong> My e-mail address is <a href="mailto:admin@cryto.net">admin@cryto.net</a>.
|
|
|
|
.no-solutions(show="{solution === false}")
|
|
h2 Sorry, I couldn't find your problem.
|
|
|
|
p Please <a href="https://git.cryto.net/joepie91/why-is-npm-broken/issues/new">file an issue</a>, containing the full <code>npm install</code> output. I will try to figure out your error, and add detection for it to this tool as well!
|
|
|
|
//p Please paste your output to a pastebin like <a href="https://gist.github.com/">GitHub Gist</a>, and send it to me on IRC or by e-mail. I will try to figure out your error, and add detection for it to this tool as well!
|
|
|
|
//p <strong>IRC:</strong> You can find me on Freenode in #Node.js as <em>joepie91</em>.
|
|
|
|
//p <strong>E-mail:</strong> My e-mail address is <a href="mailto:admin@cryto.net">admin@cryto.net</a>.
|
|
|
|
style(scoped, type="scss").
|
|
h2 {
|
|
margin-top: 32px;
|
|
}
|
|
|
|
solution {
|
|
display: none;
|
|
}
|
|
|
|
.libraryBoxes, .moduleBoxes {
|
|
margin-top: 12px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.clear {
|
|
clear: both;
|
|
}
|
|
|
|
script.
|
|
const $ = require("jquery");
|
|
const flatten = require("arr-flatten");
|
|
const dedupe = require("dedupe");
|
|
const findPackages = require("../find-packages");
|
|
|
|
this.mixin(require("riot-query").mixin);
|
|
|
|
Object.assign(this, {
|
|
viewTopic: (topic, data) => {
|
|
let solutions = this.query("solution");
|
|
|
|
this.solution = topic;
|
|
|
|
solutions.forEach((solution) => {
|
|
$(solution.root).hide();
|
|
});
|
|
|
|
solutions.filter((solution) => {
|
|
return solution.opts.topic === topic;
|
|
}).forEach((solution) => {
|
|
$(solution.root).show();
|
|
solution.setData(data);
|
|
this.offendingModule = data.offendingModule;
|
|
});
|
|
|
|
this.update();
|
|
},
|
|
_missingLibraryHandler: (data) => {
|
|
this.missingLibraries = dedupe(flatten(data.missingLibraries.map((library) => {
|
|
let knownPackages = findPackages(library);
|
|
|
|
if (knownPackages.length > 0) {
|
|
return knownPackages;
|
|
} else {
|
|
return {
|
|
headerNames: [library]
|
|
}
|
|
}
|
|
})));
|
|
|
|
this.hasUnknownLibraries = (this.missingLibraries.some((library) => library.name == null));
|
|
|
|
this.update();
|
|
},
|
|
_missingModuleHandler: (data) => {
|
|
this.missingModules = data.missingModules;
|
|
this.update();
|
|
}
|
|
});
|