我使用的是react native和Expo。我无法构建新的应用程序,因为在我使用expo init appName后,它显示以下错误。下面是完整的信息:
Using npm to install packages. You can pass --yarn to use Yarn instead.
√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web我多次尝试创建一个空白项目,也尝试npm install安装失败/未下载的库,并在失败后继续,但它显示了另一个错误:
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file我也尝试了显示缓存是ok Content verified: 3562 (252580364 bytes)的npm cache verify。
那么,我该如何解决这个问题呢?
发布于 2021-03-23 16:10:14
上面的解决方案对我不起作用,但是如果你在应用程序目录中使用'npm install‘,你会得到一个提示,你应该尝试'npm install --force’err message
在项目开始时,您应该拥有所有这些文件、文件夹和文件,否则并没有安装所有的依赖项,这就是我们遇到问题的原因。folder structure
在将--force添加到npm install之后,您就安装了所有依赖项。现在,您可以使用npm start运行该应用程序。
https://stackoverflow.com/questions/62627070
复制相似问题