无法安装 react-native-navigation 模块。抛出错误 "ENOENT: no such file or directory"

Failed to install react-native-navigation module. Thrown error "ENOENT: no such file or directory"

我尝试使用 npm 安装 react-native-navigation (by wix) 包很多次。该过程已启动,但由于某种原因尚未完成。我第一次尝试取消它,然后再次进行安装。由于某种原因 npm 无法安装包并开始退出并出现以下错误:

679 error enoent ENOENT: no such file or directory, rename 'D:\Workspace\pokemonn\node_modules\hoist-non-react-statics' -> 'D:\Workspace\pokemonn\node_modules\.hoist-non-react-statics.DELETE'
680 error enoent This is related to npm not being able to find a file.
681 verbose exit [ -4058, true ]

我在 Window 机器上,安装了节点 10.x LTS & npm 6.x & react-native 0.57.8。

这个问题早就解决了,忘记更新了

github 上打开了一个线程,我后来发现它与 npm 安装有关。按照提到的步骤进行操作后,我就可以安装它了。 以下是步骤:

从项目文件夹中删除 node_modules 目录和 package-lock.json 文件 输入 npm cache clean --force 并按 Enter 输入 npm install -g react-native-navigation 并按 Enter

[更多:Github article]