Ошибка при установке модулей с использованием npm и expo

#reactjs #react-native #npm #expo

Вопрос:

Я довольно новичок в React.js и реагируют-родные. Я пытался изучить основы навигации и, используя документацию, натолкнулся на то, что мне нужно установить навигационный модуль. Я побежал expo install react-native-screens react-native-safe-area-context , что привело к ОШИБКЕ:

 npm ERR! code ENOENT npm ERR! syscall rename npm ERR! path C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-screens npm ERR! dest C:UserstanisVScode projectsFrontendtestappnode_modules.react-native-screens.DELETE npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, rename 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-screens' -gt; 'C:UserstanisVScode projectsFrontendtestappnode_modules.react-native-screens.DELETE'  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:  npm ERR! C:UserstanisAppDataRoamingnpm-cache_logs2021-11-11T14_48_44_166Z-debug.log  npm exited with non-zero code: 4294963238  

После чего я попытался исправить любые ошибки, используя то, что я использовал npm audit fix (это было решение, которое я нашел в Интернете). Где я получил предупреждение, которого не понял:

 npm WARN react-native@0.66.3 requires a peer of react@17.0.2 but none is installed. You must install peer dependencies yourself.  

Я также попробовал npm install react-navigation , который работал без каких-либо ошибок, а затем expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view , чтобы убедиться, что я установил все зависимости, которые были рекомендованы в StackOverflow, и наткнулся на эту ошибку:

 npm ERR! code EPERM npm ERR! syscall rename npm ERR! path C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json.3463935938 npm ERR! dest C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json  npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, rename 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json.3463935938' -gt; 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json' npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json.3463935938' -gt; 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json'] {  npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json.3463935938' -gt; 'C:UserstanisVScode projectsFrontendtestappnode_modulesreact-native-gesture-handlerpackage.json'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\Users\tanis\VScode projects\Frontend\testapp\node_modules\react-native-gesture-handler\package.json.3463935938', npm ERR! dest: 'C:\Users\tanis\VScode projects\Frontend\testapp\node_modules\react-native-gesture-handler\package.json' npm ERR! }, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'rename', npm ERR! path: 'C:\Users\tanis\VScode projects\Frontend\testapp\node_modules\react-native-gesture-handler\package.json.3463935938', npm ERR! dest: 'C:\Users\tanis\VScode projects\Frontend\testapp\node_modules\react-native-gesture-handler\package.json', npm ERR! parent: 'testapp' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by  a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.  npm ERR! A complete log of this run can be found in:  npm ERR! C:UserstanisAppDataRoamingnpm-cache_logs2021-11-11T15_01_29_494Z-debug.log  npm exited with non-zero code: 4294963248  

В ходе последнего аудита я получил следующие результаты:

 found 16 vulnerabilities (1 low, 4 moderate, 11 high)   run `npm audit fix` to fix them, or `npm audit` for detail