当前位置: 首页 > article >正文

Cannot find module @rollup/rollup-win32-x64-msvc

方法1

在package.json中添加postinstall:

"scripts": {
    "postinstall": "node -e \"const { platform } = process; if (platform === 'win32') {  require('child_process').execSync('npm install @rollup/rollup-win32-x64-msvc', { stdio: 'inherit' }); } else if (platform === 'linux') { require('child_process').execSync('npm install @rollup/rollup-linux-x64-musl', { stdio: 'inherit' }); } else if (platform === 'darwin') {require('child_process').execSync('npm install @rollup/rollup-darwin-x64', { stdio: 'inherit' }); } else { console.log('Unsupported platform:', platform); }\""
  },

方法2

在package.json中添加optionalDependencies:

"optionalDependencies": {
    "@rollup/rollup-win32-x64-msvc": "4.36.0",
    "@rollup/rollup-win32-arm64-msvc": "4.36.0",
    "@rollup/rollup-win32-ia32-msvc": "4.36.0",

    "@rollup/rollup-darwin-x64": "4.36.0",
    "@rollup/rollup-darwin-arm64": "4.36.0",

    "@rollup/rollup-linux-x64-gnu": "4.36.0",
    "@rollup/rollup-linux-x64-musl": "4.36.0",
    "@rollup/rollup-linux-arm-gnueabihf": "4.36.0",
    "@rollup/rollup-linux-arm-musleabihf": "4.36.0",
    "@rollup/rollup-linux-arm64-gnu": "4.36.0",
    "@rollup/rollup-linux-arm64-musl": "4.36.0",
    "@rollup/rollup-linux-loongarch64-gnu": "4.36.0",
    "@rollup/rollup-linux-powerpc64le-gnu": "4.36.0",
    "@rollup/rollup-linux-riscv64-gnu": "4.36.0",
    "@rollup/rollup-linux-s390x-gnu": "4.36.0"
  },

方法3

在package-lock.json中添加对应的包和版本:

"node_modules/@rollup/rollup-darwin-arm64": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.36.0.tgz",
      "integrity": "sha512-JQ1Jk5G4bGrD4pWJQzWsD8I1n1mgPXq33+/vP4sk8j/z/C2siRuxZtaUA7yMTf71TCZTZl/4e1bfzwUmFb3+rw==",
      "cpu": [
        "arm64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "darwin"
      ]
    },
    "node_modules/@rollup/rollup-darwin-x64": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.36.0.tgz",
      "integrity": "sha512-6c6wMZa1lrtiRsbDziCmjE53YbTkxMYhhnWnSW8R/yqsM7a6mSJ3uAVT0t8Y/DGt7gxUWYuFM4bwWk9XCJrFKA==",
      "cpu": [
        "x64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "darwin"
      ]
    },
    "node_modules/@rollup/rollup-linux-arm64-gnu": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.36.0.tgz",
      "integrity": "sha512-KqjYVh3oM1bj//5X7k79PSCZ6CvaVzb7Qs7VMWS+SlWB5M8p3FqufLP9VNp4CazJ0CsPDLwVD9r3vX7Ci4J56A==",
      "cpu": [
        "arm64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "linux"
      ]
    },
    "node_modules/@rollup/rollup-linux-arm64-musl": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.36.0.tgz",
      "integrity": "sha512-QiGnhScND+mAAtfHqeT+cB1S9yFnNQ/EwCg5yE3MzoaZZnIV0RV9O5alJAoJKX/sBONVKeZdMfO8QSaWEygMhw==",
      "cpu": [
        "arm64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "linux"
      ]
    },
    "node_modules/@rollup/rollup-linux-x64-gnu": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.36.0.tgz",
      "integrity": "sha512-5KtoW8UWmwFKQ96aQL3LlRXX16IMwyzMq/jSSVIIyAANiE1doaQsx/KRyhAvpHlPjPiSU/AYX/8m+lQ9VToxFQ==",
      "cpu": [
        "x64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "linux"
      ]
    },
    "node_modules/@rollup/rollup-linux-x64-musl": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.36.0.tgz",
      "integrity": "sha512-sycrYZPrv2ag4OCvaN5js+f01eoZ2U+RmT5as8vhxiFz+kxwlHrsxOwKPSA8WyS+Wc6Epid9QeI/IkQ9NkgYyQ==",
      "cpu": [
        "x64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "linux"
      ]
    },
    "node_modules/@rollup/rollup-win32-arm64-msvc": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.36.0.tgz",
      "integrity": "sha512-qbqt4N7tokFwwSVlWDsjfoHgviS3n/vZ8LK0h1uLG9TYIRuUTJC88E1xb3LM2iqZ/WTqNQjYrtmtGmrmmawB6A==",
      "cpu": [
        "arm64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "win32"
      ]
    },
    "node_modules/@rollup/rollup-win32-x64-msvc": {
      "version": "4.36.0",
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.36.0.tgz",
      "integrity": "sha512-aRXd7tRZkWLqGbChgcMMDEHjOKudo1kChb1Jt1IfR8cY/KIpgNviLeJy5FUb9IpSuQj8dU2fAYNMPW/hLKOSTw==",
      "cpu": [
        "x64"
      ],
      "license": "MIT",
      "optional": true,
      "os": [
        "win32"
      ]
    },

环境

C:\workspace\app-ems-global-admin\app>node -v
v22.13.0

C:\workspace\app-ems-global-admin\app>npm -v
10.9.2

http://www.kler.cn/a/593944.html

相关文章:

  • Linux驱动学习笔记(五)
  • 解锁C++标准库:从理论到实战的进阶指南
  • 【电路笔记】-D型触发器
  • Java的输入
  • page.json和manifest.json
  • 蓝桥杯备考:数学问题模运算---》次大值
  • DeepSeek重构产业生态:餐饮、金融与短视频的智能跃迁
  • SAP-ABAP:SAP系统架构技术白皮书
  • 注册安全工程师考试科目有哪些?
  • 第J3周:DenseNet121算法实现01(Pytorch版)
  • 部分标签数据集生成与过滤特定标签方法
  • AcWing 838:堆排序 ← 数组模拟
  • 双碳战略下的电能质量革命:解码电力系统的健康密码
  • oracle 索引
  • 世界职业院校技能大赛(软件测试)技术创新思路分享(二)
  • VSCode C/C++ 开发环境完整配置及常见问题
  • Android Launcher3终极改造:全屏应用展示实战!深度解析去除Hotseat的隐藏技巧
  • 数据结构之栈(C语言)
  • 轨道交通DSP+FPGA主控板(6U)板卡,支持逻辑控制、数据处理、通信管理、系统安全保护切换等功能
  • NET6 WebApi第5讲:中间件(源码理解,俄罗斯套娃怎么来的?);Web 服务器 (Nginx / IIS / Kestrel)、WSL、SSL/TSL