0

I forked [TimboKZ's Chonky] and made some changes to it to suit my project. (link: https://github.com/TimboKZ/Chonky) I followed every step that this article says. when I run npm i, my terminal returns some error like this:

PS C:\Users\lifan\Desktop\Ubiq\New folder> npm i
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\chonky\packages\chonky" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lifan\AppData\Roaming\npm-cache\_logs\2021-02-11T23_14_30_825Z-debug.log

And this is how my package.json looks like:

"chonky": "https://github.com/Lethees/Chonky.git",
"chonky-icon-fontawesome": "https://github.com/Lethees/Chonky.git",

What should I do to successfully import the forked repo as a dependency? I noticed that TimboKZ has both 'Chonky' and 'Chonky-icon-fontawesome' in his 'package' folder, which are the two dependencies I want to import. Each dependency has a package.json. could it be something related to the errors I am getting?

Fangyi Li
  • 41
  • 1
  • 8
  • It might just be the format of the url. Try some of the answers here https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly – SimplyComplexable Feb 12 '21 at 21:01
  • Why don't you want to use --save-dev? You can do with this: `-D, --save-dev`: Package will appear in your `devDependencies`. – ht13 Feb 12 '21 at 21:01
  • 3
    Does this answer your question? [How to install an npm package from GitHub directly?](https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly) – SimplyComplexable Feb 12 '21 at 21:02
  • @huseyint Could you show me the full code? – Fangyi Li Feb 13 '21 at 02:19
  • @SimplyComplexable this only gives me following error: "npm ERR! Can't install git+https://github.com/Lethees/Chonky.git#93c076f38cf0c62797b4d5f2836ad508fb4ad219: Missing package version." And it still throws errors even if I modified the package.json.I believe it's due to one repo contains two dependencies, for which might have to separate 'chonky' from 'chonky-awesome-icon.' – Fangyi Li Feb 13 '21 at 02:25

1 Answers1

0

The following are helpful for your issue.

You can use those commands in the CLI

npm i chocky --save-dev :

 ...},
  "devDependencies": {
    "chonky": "^2.1.0"
  }

npm i chocky :

"dependencies": {
    ...
    "chonky": "^2.1.0",
    ....
ht13
  • 633
  • 7
  • 19