如何摆脱 react-native 开发中的严重错误?

How to get rid of enoent error in react-native development?

我一次又一次地遇到这个错误,并且在开发 react-native 应用程序时对 npm 中的这个错误感到非常困惑。每当我为一个包解析 enoent 包并尝试安装另一个包时,我都会收到此错误。请尊重您,帮助我了解使用该软件包的明显区别并避免出现此错误。 代码在这里:

    PS C:\Users\subba-workstation\Desktop\ecom-App-stlwrt> npm install @react-navigation/drawer
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\subba-workstation\Desktop\ecom-App-stlwrt\node_modules\@react-navigation\drawer
npm ERR! dest C:\Users\subba-workstation\Desktop\ecom-App-stlwrt\node_modules\@react-navigation\.drawer.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\subba-workstation\Desktop\ecom-App-stlwrt\node_modules\@react-navigation\drawer' -> 'C:\Users\subba-workstation\Desktop\ecom-App-stlwrt\node_modules\@react-navigation\.drawer.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:\Users\subba-workstation\AppData\Roaming\npm-cache\_logs20-09-24T12_27_04_997Z-debug.log

你应该试试:

  1. npm cache clean -f
  2. rm -rf node_modules
  3. npm i

不足之处请评论

我认为问题出在后台 运行 的地铁捆绑器上。一旦停止并尝试再次安装,它就成功了。当其他包出错时,同样的过程也有效。