下载和提取项目文件时出错 无效的响应主体 ~blah~ expo-template-bare-minimum: EACCES: permission denied
Something went wrong in downloading and extracting project files Invalid response body ~blah~ expo-template-bare-minimum: EACCES: permission denied
所以我在初始化 expo 项目时遇到了问题,一切正常,我在 node v14.16.1 (npm v7.11.2)
使用 nvm
。
expo init Doorgy
✔ Choose a template: › minimal bare and minimal, just the essentials to get you started
✖ Something went wrong in downloading and extracting the project files.
Invalid response body while trying to fetch https://registry.npmjs.org/expo-template-bare-minimum: EACCES: permission denied, open '/home/anthonykung/.expo/template-cache/tmp/0d1e04ab'
FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/expo-template-bare-minimum: EACCES: permission denied, open '/home/anthonykung/.expo/template-cache/tmp/0d1e04ab'
at /home/anthonykung/.npm-global/lib/node_modules/expo-cli/node_modules/minipass-fetch/lib/body.js:162:15
at extractTemplateAppAsync (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/utils/extractTemplateAppAsync.ts:118:3)
at extractAndPrepareTemplateAppAsync (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/utils/extractTemplateAppAsync.ts:82:3)
at action (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/commands/init.ts:270:19)
at Command.<anonymous> (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/exp.ts:350:7)
无论我做什么,它都一直向我抛出错误,我尝试修复 npm
,我尝试修复 nvm
,使用不同的版本,卸载,弄乱注册表,几乎所有我能做的找到了,但它一直显示这个恼人的错误...
这是我所做的一长串清单:
npm install -g npm@latest
npm install -g expo-cli
sudo npm install -g expo-cli
node -v
sudo apt-get update
npm cache verify
sudo expo init Doorgy
npm config set registry https://registry.npmjs.org/
vi ~/.npmrc
npm outdated -g
npm uninstall -g expo-cli
npm install -g expo-cli
expo init Doorgy
~/.npm-global
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
npm config delete prefix
expo init Doorgy
npm config set prefix $NVM_DIR/versions/node/v14.16.1
expo init Doorgy
npm config set prefix '~/.npm-global'
vi ~/.profile
source ~/.profile
npm i -g expo-cli
expo init Doorgy
nvm use default
npm i -g expo-cli
expo init Doorgy
npm config delete prefix
npm i -g expo-cli
npm cache verify
sudo npm i -g expo-cli
npm i -g expo-cli
expo init Doorgy
nvm use default
sudo npm i -g expo-cli
expo init Doorgy
npm cache clean
cd
ls
ls -al
cd dev/DoorgyApp/
expo init Doorgy
npx expo init Doorgy
sudo npm install --unsafe-perm -g expo-cli
expo init Doorgy
npm config set strict-ssl false
expo init Doorgy
npm config set strict-ssl true
npm uninstall expo-cli
npm uninstall -g expo-cli
nvm use default
cp ~/.npmrc ~/.old-npmrc
vi ~/.npmrc
expo init Doorgy
npm uninstall -g expo-cli
sudo npm uninstall -g expo-cli
其中 none 行得通,所以我随机做了一些事情,结果行得通...请参阅下面的答案
我做了所有事情,包括以下内容:
npm cache verify
sudo npm install --unsafe-perm -g expo-cli
npm config set strict-ssl false
但它们都不起作用,所以我决定卸载 expo-cli 并重新安装。所以我
npm uninstall -g expo-cli
令我惊讶的是,它幸存了下来,我仍然可以使用expo init
,所以我很自然地给它添加了sudo,猜猜它还在那里。现在非常沮丧,我尝试从我的主目录开始删除它存在的每个地方。
rm -rf /home/anthonykung/.expo/
rm: cannot remove '/home/anthonykung/.expo/template-cache/index-v5/d6/46/41a4d65191fd14edff849b1a5474a12dec9a503a4065b3d9fcfc568a5a3d': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/index-v5/70/6f/218f4428aaa14899cf226ad3dbf086f32f36d36b64c6e5c3423b10488c8e': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/content-v2/sha512/6d/28/efad7e78f4322111b65ccfd0dbcf763fc05cf73cc83edd751dc168af2e09437205de510f66ac3bc3289aeee7bd594cd3a8a9661e76fcd2ff263fd8dc4d11': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/content-v2/sha512/23/26/522f178834febb149d5f9085ab51a65d6c43cac596a90ac4234151594e5248f32c03efb71870cd71e355781bdb0a80907f8bcac53d31ca8c34ec0897167d': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/tmp': Permission denied
sudo rm -rf /home/anthonykung/.expo/
但是我想到了一些事情...Permission denied
听起来好像是错误博览会在大喊大叫!所以我满怀希望地再次expo init
并且...
✔ Choose a template: › minimal bare and minimal, just the essentials to get you started
✔ Downloaded and extracted project files.
Using npm to install packages.
✔ Installed JavaScript dependencies.
✔ Skipped installing CocoaPods because operating system is not on macOS.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Doorgy
- npm run android
- npm run ios # you need to use macOS to build the iOS project - use managed workflow if you need to do iOS development without a Mac
- npm run web
You can also open up the projects in the ios and android directories with their respective IDEs.
expo-updates (https://github.com/expo/expo/blob/master/packages/expo-updates/README.md) has been installed in your project. Before you do a release build, you'll need to configure a few values in Expo.plist and AndroidManifest.xml in order for updates to work.
有效!!!太棒了!!!
在我删除它之前,我检查了 ~/.expo
目录的权限和所有者,它显示了正确所有者的正确权限...我从来没有想过里面的东西坏了,删除它们是有效的.我敢肯定这只是一件罕见的事情,几乎从未发生在其他任何人身上(我直到现在才遇到过这种情况所以......)但如果它确实发生在某人身上我希望这会有所帮助
不要为 How would you like to start
使用 Default
选项,而是选择 Template from expo/examples: https://github.com/expo/examples
,它对我有用
所以我在初始化 expo 项目时遇到了问题,一切正常,我在 node v14.16.1 (npm v7.11.2)
使用 nvm
。
expo init Doorgy
✔ Choose a template: › minimal bare and minimal, just the essentials to get you started
✖ Something went wrong in downloading and extracting the project files.
Invalid response body while trying to fetch https://registry.npmjs.org/expo-template-bare-minimum: EACCES: permission denied, open '/home/anthonykung/.expo/template-cache/tmp/0d1e04ab'
FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/expo-template-bare-minimum: EACCES: permission denied, open '/home/anthonykung/.expo/template-cache/tmp/0d1e04ab'
at /home/anthonykung/.npm-global/lib/node_modules/expo-cli/node_modules/minipass-fetch/lib/body.js:162:15
at extractTemplateAppAsync (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/utils/extractTemplateAppAsync.ts:118:3)
at extractAndPrepareTemplateAppAsync (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/utils/extractTemplateAppAsync.ts:82:3)
at action (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/commands/init.ts:270:19)
at Command.<anonymous> (/home/anthonykung/.npm-global/lib/node_modules/expo-cli/src/exp.ts:350:7)
无论我做什么,它都一直向我抛出错误,我尝试修复 npm
,我尝试修复 nvm
,使用不同的版本,卸载,弄乱注册表,几乎所有我能做的找到了,但它一直显示这个恼人的错误...
这是我所做的一长串清单:
npm install -g npm@latest
npm install -g expo-cli
sudo npm install -g expo-cli
node -v
sudo apt-get update
npm cache verify
sudo expo init Doorgy
npm config set registry https://registry.npmjs.org/
vi ~/.npmrc
npm outdated -g
npm uninstall -g expo-cli
npm install -g expo-cli
expo init Doorgy
~/.npm-global
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
npm config delete prefix
expo init Doorgy
npm config set prefix $NVM_DIR/versions/node/v14.16.1
expo init Doorgy
npm config set prefix '~/.npm-global'
vi ~/.profile
source ~/.profile
npm i -g expo-cli
expo init Doorgy
nvm use default
npm i -g expo-cli
expo init Doorgy
npm config delete prefix
npm i -g expo-cli
npm cache verify
sudo npm i -g expo-cli
npm i -g expo-cli
expo init Doorgy
nvm use default
sudo npm i -g expo-cli
expo init Doorgy
npm cache clean
cd
ls
ls -al
cd dev/DoorgyApp/
expo init Doorgy
npx expo init Doorgy
sudo npm install --unsafe-perm -g expo-cli
expo init Doorgy
npm config set strict-ssl false
expo init Doorgy
npm config set strict-ssl true
npm uninstall expo-cli
npm uninstall -g expo-cli
nvm use default
cp ~/.npmrc ~/.old-npmrc
vi ~/.npmrc
expo init Doorgy
npm uninstall -g expo-cli
sudo npm uninstall -g expo-cli
其中 none 行得通,所以我随机做了一些事情,结果行得通...请参阅下面的答案
我做了所有事情,包括以下内容:
npm cache verify
sudo npm install --unsafe-perm -g expo-cli
npm config set strict-ssl false
但它们都不起作用,所以我决定卸载 expo-cli 并重新安装。所以我
npm uninstall -g expo-cli
令我惊讶的是,它幸存了下来,我仍然可以使用expo init
,所以我很自然地给它添加了sudo,猜猜它还在那里。现在非常沮丧,我尝试从我的主目录开始删除它存在的每个地方。
rm -rf /home/anthonykung/.expo/
rm: cannot remove '/home/anthonykung/.expo/template-cache/index-v5/d6/46/41a4d65191fd14edff849b1a5474a12dec9a503a4065b3d9fcfc568a5a3d': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/index-v5/70/6f/218f4428aaa14899cf226ad3dbf086f32f36d36b64c6e5c3423b10488c8e': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/content-v2/sha512/6d/28/efad7e78f4322111b65ccfd0dbcf763fc05cf73cc83edd751dc168af2e09437205de510f66ac3bc3289aeee7bd594cd3a8a9661e76fcd2ff263fd8dc4d11': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/content-v2/sha512/23/26/522f178834febb149d5f9085ab51a65d6c43cac596a90ac4234151594e5248f32c03efb71870cd71e355781bdb0a80907f8bcac53d31ca8c34ec0897167d': Permission denied
rm: cannot remove '/home/anthonykung/.expo/template-cache/tmp': Permission denied
sudo rm -rf /home/anthonykung/.expo/
但是我想到了一些事情...Permission denied
听起来好像是错误博览会在大喊大叫!所以我满怀希望地再次expo init
并且...
✔ Choose a template: › minimal bare and minimal, just the essentials to get you started
✔ Downloaded and extracted project files.
Using npm to install packages.
✔ Installed JavaScript dependencies.
✔ Skipped installing CocoaPods because operating system is not on macOS.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Doorgy
- npm run android
- npm run ios # you need to use macOS to build the iOS project - use managed workflow if you need to do iOS development without a Mac
- npm run web
You can also open up the projects in the ios and android directories with their respective IDEs.
expo-updates (https://github.com/expo/expo/blob/master/packages/expo-updates/README.md) has been installed in your project. Before you do a release build, you'll need to configure a few values in Expo.plist and AndroidManifest.xml in order for updates to work.
有效!!!太棒了!!!
在我删除它之前,我检查了 ~/.expo
目录的权限和所有者,它显示了正确所有者的正确权限...我从来没有想过里面的东西坏了,删除它们是有效的.我敢肯定这只是一件罕见的事情,几乎从未发生在其他任何人身上(我直到现在才遇到过这种情况所以......)但如果它确实发生在某人身上我希望这会有所帮助
不要为 How would you like to start
使用 Default
选项,而是选择 Template from expo/examples: https://github.com/expo/examples
,它对我有用