Error: Cannot find module ‘@rollup/plugin-replace‘

Vue知识大全 专栏收录该内容
3 篇文章 1 订阅

1、错误描述

G:\HBuilderXWork\vue-next>npm run dev

> @3.0.0-rc.5 dev G:\HBuilderXWork\vue-next
> node scripts/dev.js

[!] Error: Cannot find module '@rollup/plugin-replace'
Error: Cannot find module '@rollup/plugin-replace'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (G:\HBuilderXWork\vue-next\rollup.config.js:9:31)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.require.extensions..js (G:\HBuilderXWork\vue-next\node_modules\rollup\dist\bin\rollup:839:24)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)

2、错误原因

     在运行vue3.0源码项目时,出现Error: Cannot find module '@rollup/plugin-replace',由提示可知,是缺少@rollup/plugin-replace依赖模块

3、解决办法

     cnpm install @rollup/plugin-replace

G:\HBuilderXWork\vue-next>cnpm install @rollup/plugin-replace
/ [0/1] Installing fsevents@~2.1.2platform unsupported @rollup/plugin-replace@2.3.3 › rollup@2.23.0 › fsevents@~2.1.2 Pa
ckage require os(darwin) not compatible with your platform(win32)
- [0/1] Installing fsevents@~2.1.2[fsevents@~2.1.2] optional install error: Package require os(darwin) not compatible wi
th your platform(win32)
√ Installed 1 packages
√ Linked 8 latest versions
√ Run 0 scripts
peerDependencies link rollup@2.23.0 in G:\HBuilderXWork\vue-next\node_modules\_@rollup_plugin-replace@2.3.3@@rollup\plug
in-replace unmet with G:\HBuilderXWork\vue-next\node_modules\rollup(1.26.0)
peerDependencies link rollup@2.23.0 in G:\HBuilderXWork\vue-next\node_modules\_@rollup_pluginutils@3.1.0@@rollup\pluginu
tils unmet with G:\HBuilderXWork\vue-next\node_modules\rollup(1.26.0)
√ All packages installed (9 packages installed from npm registry, used 2s, speed 373.4kB/s, json 9(65.85kB), tarball 79
7.46kB)

 

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: 代码科技 设计师:Amelia_0503 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值