我正在使用 vite 创建一个小项目,当我尝试运行时,我不断收到此错误
npx shadcn-ui@latest init
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\user\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\user\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
我很感激任何帮助,因为我对反应还比较陌生,调试仍然是一个问题
您需要创建新文件夹“C:\Users\user\AppData\Roaming pm”并再次执行
npx shadcn-ui@latest init
命令。
当我在 git 存储库中创建应用程序时,我遇到了与您相同的错误。 所以我所做的就是在 cmd 中运行命令
npx create-next-app@latest my-app --typescript --tailwind --eslint
,然后转到创建应用程序的存储库并在其中启动命令 npx shadcn-ui@latest init
,它运行良好!