简体   繁体   English

NPM 安装错误 - 节点预 Gyp

[英]NPM Install Error - Node-Pre-Gyp

When I try to run npm-install I get:当我尝试运行 npm-install 时,我得到:

npm ERR. npm 错误。 Windows_NT 6.3:9600 npm ERR. Windows_NT 6.3:9600 npm 错误。 argv "C:\Program Files (x86)\nodejs\node.exe" "C.\Program Files (x8 6)\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR. argv "C:\Program Files (x86)\nodejs\node.exe" "C.\Program Files (x8 6)\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR. node v4.0.0 npm ERR!节点 v4.0.0 npm 错误! npm v2.14.2 npm ERR! npm v2.14.2 npm 错误! code ELIFECYCLE代码生命周期

npm ERR. npm 错误。 v8-debug@0.4:6 install: node-pre-gyp install --fallback-to-build npm ERR. v8-debug@0.4:6 安装: node-pre-gyp install --fallback-to-build npm ERR。 Exit status 1 npm ERR.退出状态 1 npm ERR。 npm ERR. npm 错误。 Failed at the v8-debug@0,4.6 install script 'node-pre-gyp install --fal lback-to-build': npm ERR: This is most likely a problem with the v8-debug package. v8-debug@0,4.6 install script 'node-pre-gyp install --fal lback-to-build' 失败:npm ERR:这很可能是 v8-debug package 的问题。 npm ERR! npm 错误! not with npm itself.不是 npm 本身。 npm ERR! npm 错误! Tell the author that this fails on your system: npm ERR!告诉作者这在您的系统上失败:npm ERR! node-pre-gyp install --fallback-to-build npm ERR! node-pre-gyp install --fallback-to-build npm 错误! You can get their info via: npm ERR!您可以通过以下方式获取他们的信息:npm ERR! npm owner ls v8-debug npm ERR! npm 所有者 ls v8-debug npm 错误! There is likely additional logging output above.上面可能还有额外的日志记录 output。

npm ERR: Please include the following file with any support request: npm ERR. npm ERR:请在任何支持请求中包含以下文件:npm ERR。 C:_Src\Personal\rzaleski\ILikeThis\npm-debug.log C:_Src\Personal\rzaleski\ILikeThis\npm-debug.log

I tried a number of things (installing VS C++ redistrib, npm install --msvs_version=2013, etc).我尝试了很多东西(安装 VS C++ 再分发,npm install --msvs_version=2013 等)。 Nothing seems to work.似乎没有任何效果。

Do you have any ideas how I can find out the actual error (the log is a bit daunting).您对我如何找出实际错误有任何想法吗(日志有点令人生畏)。

UPDATE: What I ended up doing was reverting from Node v4.0.0 to NODE v0.12.更新:我最终做的是从 Node v4.0.0 恢复到 NODE v0.12。 This is not really a fix to the issue, but it got me around my issues.这并不是真正解决问题的方法,但它让我解决了我的问题。

Go to: ( http://www.devdocs.io ) look @ the npm section. 转到:( http://www.devdocs.io )看看@npm部分。 Must use desktop, must use windows if possible (Mac layout is weird for some reason) Follow the steps detailed for "resetting npm cache" 必须使用桌面,如果可能必须使用Windows (由于某种原因,Mac布局很奇怪)请按照“重置npm缓存”详细说明的步骤

Node-gyp is a PITA and often blows up installs among other things. Node-gyp是一个PITA,经常会破坏安装程序。 I have a horrible time with it every time I come back to an environment I haven't used in a while and try to use it again. 每次我回到一段时间没有用过的环境并尝试再次使用它时,我都会度过一段可怕的时光。

Alternatively, you can uninstall node, and attempt to reinstall using chocolatey if you're on windows or brew if you're on a mac. 或者,你可以卸载节点,并尝试使用chocolatey重新安装,如果你在Windows上或brew如果你在Mac上。 Make sure you sudo commands when installing to mac. 安装到mac时,请确保sudo命令。

You're most likely going to have to clean out the npm cache, possibly reinstall nodejs, and possibly reinstall node-gyp. 您最有可能必须清理npm缓存,可能重新安装nodejs,并可能重新安装node-gyp。

NOTE: Before you go about the above mentioned steps, first make sure that your configurations are compatible, including your python version for node-gyp. 注意:在执行上述步骤之前,首先要确保您的配置兼容,包括node-gyp的python版本。 ( https://www.npmjs.com/package/node-gyp ) Also, I have solved the C++ redistributable issues several times without touching anything C++ related, just so you know this error is not indicative of C++, but rather local settings and compatible software versions that interact with node + npm NOT C++ related (for instance, your python version interacting with node-gyp) https://www.npmjs.com/package/node-gyp )另外,我已经多次解决了C ++可再发行问题而没有触及任何与C ++相关的问题,只是因为你知道这个错误不是C ++的指示,而是本地设置和兼容的软件版本,与node + npm NOT C ++相关(例如,你的python版本与node-gyp交互)

There is no straightforward "run this and that" to fix, you kind of have to muddle through it, and I can promise you that you'll have to do it more than once. 没有直接的“运行这个和那个”来解决,你有点不得不糊涂它,我可以保证你不得不多次这样做。 But the more you fix node + npm + node-gyp, the more able you will be to quickly remedy all issues in the future. 但是你修复node + npm + node-gyp的次数越多,你将来能够更快地解决所有问题。 The links above should sort you out no problem though. 上面的链接应该排除你没问题。 Just walk through them slowly and thoroughly as instructed. 按照指示慢慢彻底地穿过它们。

All i did is uninstall node and install it again, and during the installation, check the box telling you to install the needed dependencies and complete your installation.我所做的只是卸载节点并再次安装它,在安装过程中,选中告诉您安装所需依赖项并完成安装的框。

If it persists, locate the package that is causing this error and install it seperately.如果仍然存在,请找到导致此错误的 package 并单独安装。 Example: npm install -g node-gyp npm install bcrypt示例: npm install -g node-gyp npm install bcrypt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM