You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nuxt项目部署至Vercel时遭遇node-fibers模块缺失问题求助

Fixing Node-Fibers Missing File Error When Deploying Nuxt + SASS to Vercel

Hey there, let's work through this frustrating fibers issue you're facing with your Nuxt deployment on Vercel. Since you're new to SASS and this is your first deployment with it, the root cause is likely tied to how node-sass (which relies on fibers) interacts with Vercel's build environment. Here's what's going wrong and actionable fixes to try:

Why This Happens

The error is telling you that the precompiled fibers.node binary for Vercel's Linux environment is missing. This happens because:

  • node-sass uses platform-specific binary files, and the one you installed locally (probably on Windows/macOS) doesn't match Vercel's Linux server.
  • fibers is a dependency of node-sass to speed up compilation, but it often fails to cross-compile correctly in CI/CD environments like Vercel.
  • On top of that, node-sass is deprecated—it's no longer maintained, which means these compatibility issues will keep popping up.

1. Switch from node-sass to sass (Dart-Sass)

This is the most reliable long-term fix, since Dart-Sass is the official replacement for node-sass and doesn't require fibers at all. Here's how:

  • Uninstall the old dependencies:
    npm uninstall node-sass fibers
    # Or if you use yarn:
    yarn remove node-sass fibers
    
  • Install the modern SASS package:
    npm install sass
    # Or yarn add sass
    
  • Update your Nuxt config (nuxt.config.js) to remove any references to node-sass. For example, if you had a loader config like this:
    build: {
      loaders: {
        sass: { implementation: require('node-sass') }
      }
    }
    
    Delete that block or replace require('node-sass') with require('sass')—though Nuxt should automatically detect sass if it's installed.

2. Clean Dependencies and Cache

Sometimes leftover files from local installs cause mismatches. Do a fresh install:

  • Delete your node_modules folder, lock file, and Nuxt build cache:
    rm -rf node_modules package-lock.json .nuxt
    # For yarn: rm -rf node_modules yarn.lock .nuxt
    
  • Reinstall dependencies:
    npm install
    # Or yarn install
    

3. Force Fibers to Recompile on Vercel (If You Must Keep node-sass)

If you can't switch to Dart-Sass right now, you need to tell Vercel to rebuild fibers during the build process:

  • Add a prebuild script to your package.json to compile fibers before running Nuxt build:
    "scripts": {
      "prebuild": "node node_modules/fibers/build",
      "build": "nuxt build"
    }
    
  • Ensure Vercel uses the same Node.js version as your local environment. Add this to package.json:
    "engines": {
      "node": "16.x"
    }
    
    The error mentions linux-x64-93-glibc, which corresponds to Node.js 16 (since v8 engine version 93 is bundled with Node 16).
  • In your Vercel project settings, double-check that the build command is set to npm run build (or yarn build if you use yarn) so it runs the prebuild step.

4. Check for Unnecessary Fibers Imports

Double-check your nuxt.config.js (or any other config files) to make sure you aren't manually importing fibers somewhere. Old tutorials or configs might have lines like require('fibers')—remove those if they exist.

Final Notes

Sticking with Dart-Sass is strongly recommended, as node-sass has been deprecated since 2020 and won't receive updates for newer Node.js versions. This will prevent similar issues in future deployments.

内容的提问来源于stack exchange,提问作者Nicolas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 21:47:39