英文:
Cannot run any npx command
问题
每次我运行任何 npx
命令都会出现以下错误消息:
npx create-expo-app myApp
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Name\Documents\Programming\ReactNative
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
我尝试清除 npm 缓存,但没有帮助。
英文:
Every time I run any npx
command it gives me an error with the following message:
npx create-expo-app myApp
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\Name\Documents\Programming\ReactNative
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
I tried clearing the npm cache, but that didn't helped.
答案1
得分: 0
From the error, it looks like npm thinks your shell is bash
, hence the npm ERR! enoent spawn bash ENOENT
error. From the "path" in the error message, I'll assume you're working in a Windows environment, where bash
is likely not available.
You can see what your shell is by executing npm config ls -l
and looking for the script-shell
value.
See answer https://stackoverflow.com/questions/74635083/npm-enoent-syscall-spawn-bash-this-is-related-to-npm-not-being-able-to-find-a/74647007#74647007 for more details.
英文:
From the error, it looks like npm thinks your shell is bash
, hence the npm ERR! enoent spawn bash ENOENT
error. From the "path" in the error message, I'll assume you're working in a Windows environment, where bash
is likely not available.
You can see what your shell is by executing npm config ls -l
and looking for the script-shell
value.
See answer https://stackoverflow.com/questions/74635083/npm-enoent-syscall-spawn-bash-this-is-related-to-npm-not-being-able-to-find-a/74647007#74647007 for more details.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论