node.js - npx create-react-app myApp 不起作用 _npx\10796" 因为它不包含 package.json 文件
问题描述
我正在尝试为 React 设置我的环境,但是当我尝试运行该命令时,npx create-react-app myApp
我收到以下错误:
1) npm ERR! code ENOLOCAL
2) npm ERR! Could not install from "Guillen\AppData\Roaming\npm-cache\_npx\10796" as it does not contain a package.json file.
3) npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Andres Guillen\AppData\Roaming\npm-cache\_logs\2020-04-25T01_16_30_068Z-debug.log
La instalación de [ 'create-react-app@latest' ] fracasó con código 1.
I have this node js version : 13.2.0 , npm version: 6.13.1
我不知道如何解决这些错误,有什么想法吗?提前致谢。
解决方案
PC 名称“Andres Guillen”中有一个空格字符会导致问题。
跑:
- npm config set cache "C:\Users\ALEXAN~1\AppData\Roaming\npm-cache" --global
- npx create-react-app newapp
忽略空格字符是一种解决方法。
推荐阅读
- file - 如何在 Delphi 中创建文本文件
- scala - 如何在其他方法中设置局部变量
- java - 如何制作 JPanel 网格?
- python - Django:上下文处理器和基于类的视图
- coldfusion - Coldfusion:跨 ACF11/Lucee 4.5 RestInitApplication() 解决方案
- php - 将数组中的随机颜色分配给 wp 类别列表
- php - Laravel Post 控制器不工作(Symfony \ Component ...)
- python - Tkinter - 将多列添加到 Treeview
- angularjs - 指令“selectUser”的模板必须只有一个根元素
- selenium - 如何通过Selenium和Java点击CRM应用的登录按钮?