我的PowerShell(终端)警告,我不使用npm安装或任何一个刚刚尝试npx的npx-react-app NKE命令:
PS C:\Users\berk.BERK-PC\React Native> npx create-react-app NKE
npm WARN using --force Recommended protections disabled.
npm WARN using --force Recommended protections disabled.
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\berk.BERK-PC\React Native\'~
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\berk.BERK-PC\React Native\'~'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:\Users\berk.BERK-PC\AppData\Local\npm-cache\_logs\2023-12-28T21_08_04_536Z-debug-0.log
PS C:\Users\berk.BERK-PC\React Native>
字符串
Loc文件:
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\Users\berk.BERK-PC\React Native\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\berk.BERK-PC\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\berk.BERK-PC\React Native\'~\.npm-global'\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 9ms
17 timing npm:load:configload Completed in 9ms
18 timing config:load:flatten Completed in 1ms
19 timing npm:load:mkdirpcache Completed in 1ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm exec create-react-app NKE
22 verbose argv "exec" "--" "create-react-app" "NKE"
23 timing npm:load:setTitle Completed in 0ms
24 timing npm:load:display Completed in 1ms
25 verbose logfile logs-max:10 dir:C:\Users\berk.BERK-PC\AppData\Local\npm-cache\_logs\2023-12-28T21_08_04_536Z-
26 verbose logfile C:\Users\berk.BERK-PC\AppData\Local\npm-cache\_logs\2023-12-28T21_08_04_536Z-debug-0.log
27 timing npm:load:logFile Completed in 7ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 warn using --force Recommended protections disabled.
31 timing npm:load Completed in 39ms
32 silly logfile start cleaning logs, removing 7 files
33 timing arborist:ctor Completed in 0ms
34 silly logfile done cleaning log files
35 http fetch GET 200 https://registry.npmjs.org/create-react-app 306ms (cache revalidated)
36 timing arborist:ctor Completed in 0ms
37 timing command:exec Completed in 325ms
38 verbose stack Error: ENOENT: no such file or directory, lstat 'C:\Users\berk.BERK-PC\React Native\'~'
39 verbose cwd C:\Users\berk.BERK-PC\React Native
40 verbose Windows_NT 10.0.22621
41 verbose node v20.10.0
42 verbose npm v10.2.3
43 error code ENOENT
44 error syscall lstat
45 error path C:\Users\berk.BERK-PC\React Native\'~
46 error errno -4058
47 error enoent ENOENT: no such file or directory, lstat 'C:\Users\berk.BERK-PC\React Native\'~'
48 error enoent This is related to npm not being able to find a file.
48 error enoent
49 verbose exit -4058
50 timing npm Completed in 673ms
51 verbose code -4058
52 error A complete log of this run can be found in: C:\Users\berk.BERK-PC\AppData\Local\npm-cache\_logs\2023-12-28T21_08_04_536Z-debug-0.log
型
我需要创建一个应用程序,我该如何解决这个问题,有人可以帮助我吗?我安装了节点,我在系统环境变量中添加,但不工作。
2条答案
按热度按时间1l5u6lss1#
为了在Windows中创建react-native应用程序,请按照以下步骤操作:
如果你是react-native的新手,那么我建议你去react-native页面安装,因为他们会给予你简单的安装方法=> https://reactnative.dev/docs/environment-setup
下面是一个简化版本:
1.学习如何安装npm包管理器或node js相关依赖项
下面是另一个安装指南一步一步:
1.安装Node.js
字符串
型
5kgi1eie2#
如果你是react-native的新手,那么我建议你选择expo(expo是react-native的顶级,它让开发者的生活变得简单)。
以下是世博会的解释:
关于react-native https://reactnative.dev/docs/environment-setup的更多详情,请查看结帐文档。
现在我们来讨论一个解决方案
字符串
型
型