简体   繁体   English

反应本机应用程序; 启动打包程序时出错:错误:EPERM:不允许操作

[英]React Native application; Error starting packager: Error: EPERM: operation not permitted

WINDOWS 10 I've been trying to find the solution for this all day and haven't found a suitable answer. WINDOWS 10我整天都在努力寻找解决方案,但没有找到合适的答案。 I am attempting to create a react native project. 我正在尝试创建一个React Native项目。 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. 今天早些时候,我能够完成创建应用程序的工作,然后陷入尝试使用Expo同步我的android设备的过程。 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. 在修改网络设置时,我似乎有些混乱,因为现在我什至无法到达命令提示符下的“ Expo”屏幕。 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. 我可以在终端中创建该应用程序,然后当我输入“ npm start”时,它表示正在启动打包程序,然后在大约10秒钟后超时并给出一些错误消息。 I have uninstalled and reinstalled nodejs, moved my project to a completely new folder, and the issue persists. 我已经卸载并重新安装了nodejs,将项目移到了一个全新的文件夹中,问题仍然存在。

This is the code that prints out in the command prompt 这是在命令提示符下打印出的代码

npm ERR! npm ERR! code ELIFECYCLE 代码ELIFECYCLE
npm ERR! npm ERR! errno 1 errno 1
npm ERR! npm ERR! todoapp@0.1.0 start: react-native-scripts start todoapp@0.1.0开始: react-native-scripts start
npm ERR! npm ERR! Exit status 1 退出状态1
npm ERR! npm ERR!
npm ERR! npm ERR! Failed at the todoapp@0.1.0 start script. 在todoapp@0.1.0启动脚本处失败。
npm ERR! npm ERR! This is probably not a problem with npm. npm可能不是问题。 There is likely additional logging output above. 上面可能还有其他日志记录输出。

npm ERR! npm ERR! A complete log of this run can be found in: 可以在以下位置找到此运行的完整日志:
npm ERR! npm ERR! C:\\Users\\cembr\\AppData\\Roaming\\npm-cache_logs\\2018-08-18T03_05_05_427Z-debug.log 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 ]

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找到

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. 杀死-9 PID的进程,您可以再次启动NPM,然后它将起作用。

for finding the process 寻找过程

lsof -i:8081 then lsof -i:8081然后

kill -9 PID of the process of node 杀死节点进程的-9 PID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM