rollup 插件无法识别已安装的 rollup

Joh*_*han 3 rollupjs

我在全球范围内安装了 rollup:

npm install -g rollup
Run Code Online (Sandbox Code Playgroud)

然后,我尝试在本地安装一个插件:

C:\wwwroot\speech-to-text [master +9 ~0 -0 !]> npm install rollup-plugin-json
npm WARN rollup-plugin-babel@4.0.3 requires a peer of rollup@>=0.60.0 <1 but none is installed. You must install peer dependencies yourself.
npm WARN rollup-plugin-commonjs@9.1.8 requires a peer of rollup@>=0.56.0 but none is installed. You must install peer dependencies yourself.
npm WARN speech-to-text@1.0.0 No repository field.

+ rollup-plugin-json@3.1.0
updated 1 package in 1.895s
Run Code Online (Sandbox Code Playgroud)

它会发出警告,提示未安装汇总。有谁知道为什么?这是我检查的版本,以防您怀疑是否实际安装了 rollup:

C:\wwwroot\speech-to-text [master +9 ~0 -0 !]> rollup -v
rollup v0.66.2
Run Code Online (Sandbox Code Playgroud)

sun*_*oft 6

我相信问题是您已经在全局上下文中安装了汇总。

您可以尝试通过这种方式安装 rollup

npm install rollup --save-dev
Run Code Online (Sandbox Code Playgroud)