【发布时间】:2021-10-14 04:56:38
【问题描述】:
我正在尝试通过 yarn yarn add react-native-gesture-handler@1.10.2 安装以下包。我阅读了这个问题的多个答案,但没有一个有用。我认为问题可能来自于我使用的是 windows 计算机但不知道如何解决它。
每当您尝试执行yarn add ..@version 时,我都会收到以下错误:
yarn add v1.22.11
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is
advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "C:\\Users\\...\\AppData\\Local\\Yarn\\Cache\\v6\\npm-unbox-primitive-1.0.1-085e215625ec3162574dc8859abee78a59b14471-integrity\\node_modules\\unbox-primitive\\.yarn-metadata.json:
Unexpected token \u0000 in JSON at position 0".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\...\\OneDrive\\Documents\\GitHub\\wc_app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
【问题讨论】: