14

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

我正在使用 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
4

7 回答 7

21

这对我有用:

npm install --global --production windows-build-tools    
npm install --global node-gyp
于 2017-03-23T14:00:01.363 回答
9

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

如果您在 Linux、OS X 或 Windows(7 或更高版本)上运行 NodeJS 版本 4.x、5.x 或 6.x,那么您应该能够从 npm 安装纤程就好了。如果您正在运行较旧(或较新)版本的节点或其他操作系统,则必须在系统上编译纤程。

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

npm i fibers@1.0.15 
于 2018-05-19T14:34:52.367 回答
2

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

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

  • 安装gcc, g++,make只是build-essential为了确定。
  • npm install -g node-gyp

我不太了解OSX,但我希望它有所帮助!

于 2018-05-28T13:38:41.657 回答
1

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

于 2021-03-01T19:15:36.787 回答
0

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

npm run build在 Mac (Big Sur) 上,我的(for 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
于 2021-12-31T15:50:27.060 回答
0

我有“纤维”:“3.1.1”。所以我卸载了节点 14 并安装了节点 11。 它工作正常。

于 2021-05-25T09:52:01.007 回答
0

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

于 2019-08-14T18:55:53.140 回答