【问题标题】:npm install fibers shows errornpm install fiber 显示错误
【发布时间】:2014-08-30 05:38:28
【问题描述】:

当我尝试使用 npm install 纤维安装纤维时,我遇到了以下错误,我还尝试了堆栈溢出中的其他解决方案,但都没有帮助,请帮助

我正在使用 OSX 10.8.5

> fibers@1.0.1 install /usr/local/lib/node_modules/fibers
> node ./build.js

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F    (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack     at E    (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-             

gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/fibers
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 
Build failed
npm ERR! fibers@1.0.1 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fibers@1.0.1 install script.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls fibers
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.5.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "fibers@1.0.1" "-g"
npm ERR! cwd /Users/mac/Documents/node/node-fibers
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!  
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mac/Documents/node/node-fibers/npm-debug.log
npm ERR! not ok code 0

【问题讨论】:

  • 您需要安装“make”才能安装这些模块。遗憾的是,我无法告诉您如何在 Mac 上执行此操作。
  • 我已经制作了我的,但它没有安装。类似的错误,纤维是罪魁祸首

标签: node.js node-fibers


【解决方案1】:

这对我有用:

npm install --global --production windows-build-tools    
npm install --global node-gyp

【讨论】:

  • 如果操作人员说他们使用的是 OSX,这对他们有什么帮助?
  • 它适用于 Windows。我正在使用截至 2020 年 10 月 31 日的最新节点版本
【解决方案2】:

就我而言,我无法安装光纤,因为我使用的节点版本不正确。我使用了节点 10。 来自光纤readme

如果您在 Linux、OS X 或 Windows(7 或更高版本),那么您应该能够从 npm 就好了。如果您正在运行较旧(或较新)版本的节点 或其他一些操作系统,您将不得不在您的 系统。

所以我降级到节点 6。 它安装得很好。

npm i fibers@1.0.15 

【讨论】:

  • 太棒了——这很好用,我已经在配置文件中放了一些东西,但它没有完全工作。这个明确的命令挽救了这一天。我专门用过:npm i fiber@4.0.3
【解决方案3】:

我也遇到了同样的情况,但是在 Ubuntu 中,ASHISH RANJAN 为我解决了缺少 node-gyp 的问题,并且我可以成功安装它(谢谢!)。但是根据您的日志,我可以说您缺少make

我使用 Ubuntu 18.04 LTS 和 Node 10,这就是我所做的:

  • 安装 gccg++makebuild-essential 以确保安全。
  • npm install -g node-gyp

我对 OSX 了解不多,但希望对您有所帮助!

【讨论】:

    【解决方案4】:

    我使用的是节点 15.10。 我卸载它并安装 LTS (14.16) 并且它工作正常。

    【讨论】:

      【解决方案5】:

      对于想要将 Node 升级到 10 及更高版本的人,您必须找到 Node 10 过时的依赖项并将这些包升级到更新的稳定版本,然后构建(npm/yarn install)。

      【讨论】:

        【解决方案6】:

        我有“纤维”:“3.1.1”。 所以我卸载了节点 14 并安装了节点 11。 并且成功了。

        【讨论】:

          【解决方案7】:

          我想扩展@Mahmoud.Ismail的答案。

          在 Mac (Big Sur) 上,npm run build(用于 Webpack)命令出现此错误:

          ## There is an issue with `node-fibers` ##
          `/app/node_modules/fibers/bin/darwin-x64-67/fibers.node` is missing.
          
          Try running this to fix the issue: /Users/[username]/.nvm/versions/node/v14.18.2/bin/node /app/node_modules/fibers/build
          

          我认为它发生在切换 Node 版本(使用 NVM)时。

          我的解决方案:

          1. 切换到 Node v11(为了兼容 Fibers 3.1.1)例如nvm i 11 ; nvm use 11
          2. 删除你的 node_modules 目录
          3. 重新安装:npm i
          4. 重新运行您的 npm 命令,例如npm run build

          【讨论】:

            猜你喜欢
            • 2014-06-03
            • 2017-12-25
            • 2019-10-21
            • 2021-07-04
            • 2018-07-29
            • 2017-07-02
            • 2020-04-20
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多