degit running error: ENOENT: no such file or directory, scandir '~/.degit'

huangapple go评论63阅读模式
英文:

degit running error: ENOENT: no such file or directory, scandir '~/.degit'

问题

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 instruction 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 caused the problem, the way I installed npm or degit? How can I fix the problem? Thanks!

英文:

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 &#39;~/.degit&#39;
    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.&lt;anonymous&gt; (/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: &#39;scandir&#39;,
  code: &#39;ENOENT&#39;,
  path: &#39;~/.degit&#39;
}

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

得分: 0

创建一个名为~/.degit的目录似乎有趣,我不知道为什么安装过程不会自动完成这一步。

英文:

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.

huangapple
  • 本文由 发表于 2023年5月7日 03:06:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76190632.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定