React Native应用程序;启动packager时出错:错误:EPERM:不允许操作

时间:2023-02-04 06:31:03

WINDOWS 10 I've been trying to find the solution for this all day and haven't found a suitable answer. I am attempting to create a react native project. Earlier today, I was able to get past the point of creating the app, and then I got stuck trying to sync up my android device using Expo. While tinkering with my network settings I seem to have messed something up, because now I can't even get as far as the Expo screen in command prompt. I'm able to create the app in the terminal, and then when I enter 'npm start' it says it is starting packager, and then times out about 10 seconds later and gives some error messages. I have uninstalled and reinstalled nodejs, moved my project to a completely new folder, and the issue persists.

WINDOWS 10我一直试图找到解决方案,并且找不到合适的答案。我正在尝试创建一个反应原生项目。今天早些时候,我能够超越创建应用程序的点,然后我试图使用Expo同步我的Android设备。在修补我的网络设置的同时,我似乎搞砸了一些事情,因为现在我甚至无法在命令提示符下到达Expo屏幕。我能够在终端中创建应用程序,然后当我输入'npm start'时它表示它正在启动打包器,然后在大约10秒后超时并提供一些错误消息。我已经卸载并重新安装了nodejs,将我的项目移动到一个全新的文件夹,问题仍然存在。

This is the code that prints out in the command prompt

这是在命令提示符下打印出来的代码

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todoapp@0.1.0 start: react-native-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todoapp@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

错误的ERR!代码ELIFECYCLE npm ERR!错误1 npm ERR! todoapp@0.1.0 start:react-native-scripts启动npm ERR!退出状态1 npm ERR!错误的ERR!在todoapp@0.1.0启动脚本失败。错误的ERR!这可能不是npm的问题。上面可能有额外的日志记录输出。

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\cembr\AppData\Roaming\npm-cache_logs\2018-08-18T03_05_05_427Z-debug.log

错误的ERR!可以在以下位置找到此运行的完整日志:npm ERR! C:\ Users \用户cembr \应用程序数据\漫游\ NPM-cache_logs \ 2018-08-18T03_05_05_427Z-的debug.log

Here is the debugging log:

这是调试日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\cembr\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@6.4.0
3 info using node@v8.11.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle todoapp@0.1.0~prestart: todoapp@0.1.0
6 info lifecycle todoapp@0.1.0~start: todoapp@0.1.0
7 verbose lifecycle todoapp@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle todoapp@0.1.0~start: PATH: C:\Users\cembr\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\cembr\OneDrive\Documents\Web Design\todoapp\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\Microsoft VS Code\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\nodejs\;C:\Users\cembr\AppData\Local\Microsoft\WindowsApps;C:\Users\cembr\AppData\Local\Yarn\bin;C:\Users\cembr\AppData\Roaming\npm
9 verbose lifecycle todoapp@0.1.0~start: CWD: C:\Users\cembr\OneDrive\Documents\Web Design\todoapp
10 silly lifecycle todoapp@0.1.0~start: Args: [ '/d /s /c', 'react-native-scripts start' ]
11 silly lifecycle todoapp@0.1.0~start: Returned: code: 1  signal: null
12 info lifecycle todoapp@0.1.0~start: Failed to exec start script
13 verbose stack Error: todoapp@0.1.0 start: `react-native-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\cembr\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\cembr\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid todoapp@0.1.0
15 verbose cwd C:\Users\cembr\OneDrive\Documents\Web Design\todoapp
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\cembr\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.11.4
19 verbose npm  v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error todoapp@0.1.0 start: `react-native-scripts start`
22 error Exit status 1
23 error Failed at the todoapp@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

2 个解决方案

#1


0  

Try typing these commands

尝试输入这些命令

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288

found from https://github.com/react-community/create-react-native-app/issues/533

发现于https://github.com/react-community/create-react-native-app/issues/533

#2


0  

This must be an error of NPM and by killing the node process using

这必须是NPM的错误,并使用杀死节点进程

kill -9 PID of the process you can start again the NPM then it will work.

kill -9 PID的过程你可以重新启动NPM然后它会工作。

for finding the process

找到过程

lsof -i:8081 then

lsof -i:8081然后

kill -9 PID of the process of node

kill -9节点进程的PID

#1


0  

Try typing these commands

尝试输入这些命令

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288

found from https://github.com/react-community/create-react-native-app/issues/533

发现于https://github.com/react-community/create-react-native-app/issues/533

#2


0  

This must be an error of NPM and by killing the node process using

这必须是NPM的错误,并使用杀死节点进程

kill -9 PID of the process you can start again the NPM then it will work.

kill -9 PID的过程你可以重新启动NPM然后它会工作。

for finding the process

找到过程

lsof -i:8081 then

lsof -i:8081然后

kill -9 PID of the process of node

kill -9节点进程的PID