how to npm install a package from github directly with rollup/plugin-babel?

593 Views Asked by At

I want to directly install the npm package "rinose/react-resizeable-rotatable-draggable" from Github because it has the onTouch event feature, which is missing in the original package mockingbot/react-resizeable-rotatable-draggable in the npm registry.

If I use "npm install react-resizeable-rotatable-draggable", it will give me the original mockingbot version without the onTouch event feature.

I have tried using "npm install git+https://github.com/rinose/react-resizable-rotatable-draggable.git" but I got the following errors.

PS C:\Users\Forge-15\Desktop\React\USM Sign\client> npm i git+https://github.com/rinose/react-resizable-rotatable-draggable.git

> [email protected] prepack C:\Users\Forge-15\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-7be54499
> npm run build


> [email protected] build C:\Users\Forge-15\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-7be54499
> rollup -c

[!] Error: Cannot find module 'rollup-plugin-babel'
Require stack:
- C:\Users\Forge-15\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-7be54499\rollup.config.js
- C:\Users\Forge-15\AppData\Roaming\npm\node_modules\rollup\dist\shared\loadConfigFile.js     
- C:\Users\Forge-15\AppData\Roaming\npm\node_modules\rollup\dist\bin\rollup
Error: Cannot find module 'rollup-plugin-babel'
Require stack:
- C:\Users\Forge-15\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-7be54499\rollup.config.js
- C:\Users\Forge-15\AppData\Roaming\npm\node_modules\rollup\dist\shared\loadConfigFile.js
- C:\Users\Forge-15\AppData\Roaming\npm\node_modules\rollup\dist\bin\rollup
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\Forge-15\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-7be54499\rollup.config.js:5:13)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.require.extensions.<computed> [as .js] (C:\Users\Forge-15\AppData\Roaming\npm\node_modules\rollup\dist\shared\loadConfigFile.js:508:20)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `rollup -c`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Forge-15\AppData\Roaming\npm-cache\_logs\2020-09-26T07_22_11_133Z-debug.log
npm ERR! premature close

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Forge-15\AppData\Roaming\npm-cache\_logs\2020-09-26T07_22_11_179Z-debug.log

I searched for 'rollup-plugin-babel' since the system complained about it. But, in its github page, it stated that "This package has moved and is now available at @rollup/plugin-babel. Please update your dependencies. This repository is no longer maintained.".

I tried to npm install @rollup/plugin-babel. But when I tried "npm install git+https://github.com/rinose/react-resizable-rotatable-draggable.git" , I still got the same error "Cannot find module 'rollup-plugin-babel'"

Please help me. Thank you!

0

There are 0 best solutions below