英文:
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.
- I first install 
node.js. It is in/usr/bin/nodeandnpmis in/usr/bin/npm - I then run 
sudo npm install -g degit, it is installed in/usr/bin/degit - 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.
- I first install 
node.js. It is in/usr/bin/nodeandnpmis in/usr/bin/npm - I then run 
sudo npm install -g degit, it is installed in/usr/bin/degit - 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
得分: 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论