首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:`C:\Program (x86)\Microsoft Visual x86失败,退出代码:1

问错误:`C:\Program (x86)\Microsoft Visual x86失败,退出代码:1
EN

Stack Overflow用户
提问于 2019-02-05 10:56:31
回答 5查看 46.5K关注 0票数 19

我正在尝试使用npm install命令安装所有依赖项,但是在安装它时会出现如下所示的错误:

代码语言:javascript
复制
ling source file ..\src\threaded_callback_invokation.cc)
c:\applatest\applatest\node_modules\nan\nan.h(1478): warning C4996: 'node::MakeCallback': was declared deprecated (comp
iling source file ..\src\threaded_callback_invokation.cc) [C:\appLatest\appLatest\node_modules\voicemeeter\node_modules
\ffi\build\ffi_bindings.vcxproj]
  c:\users\alliancetek\.node-gyp\10.15.0\include\node\node.h(176): note: see declaration of 'node::MakeCallback' (compi
  ling source file ..\src\threaded_callback_invokation.cc)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\appLatest\appLatest\node_modules\voicemeeter\node_modules\ffi
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-linux@1.3.1 (node_modules\7zip-bin-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-linux@1.3.1: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@1.0.1 (node_modules\7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffi@2.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi@2.2.0 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!     C:\Users\alliancetek\AppData\Roaming\npm-cache\_logs\2019-02-05T10_40_31_378Z-debug.log

在许多解决方案中,我尝试了npm install node-gyp,或者再次卸载或安装它,但在这方面我也遇到了同样的错误。

还可以尝试使用以下步骤:

  • 安装最新版本的Python (可能与此无关),以及"Microsoft 2017可重新发行的C++“,当然还有Node.js和NPM;
  • As Admin:$ cd "C:\Program Files\nodejs\node_modules\npm“$ npm安装节点-gyp
  • $ npm set msvs_version 2015不知道为什么。
  • 作为Admin:$ npm安装-g节点-sass,最后一次检查:$node -v

然后尝试使用npm install --production windows-build-tools,但是任何选项都无法得到结果。

所有的解决方案都试过了,但都没有效果。我已经安装了带有2.7.15、vc++构建工具、VisualStudio2017和所有必需组件的python。

我正在寻找过去两周的解决方案,请建议我正确的答案。

EN

回答 5

Stack Overflow用户

发布于 2019-02-05 11:35:48

  1. 运行:npm cache clean --force
  2. 删除node_modules
  3. 删除packagelock.json和yarn.lock(如果有)
  4. 运行:npm install
票数 26
EN

Stack Overflow用户

发布于 2020-02-12 03:58:10

这些答案在Windows 10和Node 13上都没有用。我不得不卸载Visual和构建工具,并卸载Node 13。然后,我删除了漫游中的npm和npm-缓存,然后重新安装Node 11.6并选择巧克力式安装。后来对我起了作用。

票数 4
EN

Stack Overflow用户

发布于 2021-05-06 12:29:21

  • 运行npm install --production windows-build-tools可能需要更长的时间来安装,为我的朋友工作

或

  • 重新安装nodeJs为我工作
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54532854

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档