0

I'm using Deepin v20.8, a Debian-based distribution. I try to install degit an npm package.

  1. I first install node.js. It is in /usr/bin/node and npm is in /usr/bin/npm
  2. I then run sudo npm install -g degit, it is installed in /usr/bin/degit
  3. Then I run degit, it raises the following error:
node:fs:1452
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, scandir '~/.degit'
    at Object.readdirSync (node:fs:1452:3)
    at walk (/usr/lib/node_modules/degit/dist/bin.js:525:40)
    at sync (/usr/lib/node_modules/degit/dist/bin.js:591:3)
    at main (/usr/lib/node_modules/degit/dist/bin.js:5607:3)
    at Object.<anonymous> (/usr/lib/node_modules/degit/dist/bin.js:5712:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '~/.degit'
}

Node.js v18.16.0

(I alias my user directory by ~)

It seems I've followed every instructions in the doc, I just don't understand the problem. Do I use the wrong user account to install it? I don't know which step cause the problem, the way I install npm or degit? How can I fix the problem? Thanks!

1 Answers1

0

Seems funny, the way I solve it is to create a directory ~/.degit. I have no idea why this won't be automatically done by the installation.

  • 1
    Per the issues, [your fix is the right workaround](https://github.com/Rich-Harris/degit/issues/345). This would only take a few lines of code to fix in `degit` itself, but the project seems to be abandoned. – Zac Anger May 06 '23 at 19:21
  • As @ZacAnger indicated, `degit` is currently abandoned, for information [here](https://github.com/tiged/tiged) is a community-maintained fork – sicheng mao May 07 '23 at 08:44