npm 在我的系统中无法运行Anto-react-app

jchrr9hc  于 5个月前  发布在  React
关注(0)|答案(1)|浏览(44)

当我尝试创建我的react项目时,它显示一个错误日志

C:\Users\Ezhil & rishii>npx create-react-app firstapp
'rishii\AppData\Roaming\npm\' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'C:\Users\Ezhil \node_modules\create-react-app\index.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.10.0

字符串
这是我的命令中显示的错误日志

qnyhuwrf

qnyhuwrf1#

npm路径的问题可能是因为用户名中的空格(“Ezhil & rishii”)。要解决这个问题,请转到名称中没有空格的文件夹,然后再次运行命令。下面是示例:

cd C:\Users\Ezhil_rishii // use the directory name like this
npx create-react-app firstapp

字符串

相关问题