Clean react native project

2019-06-18 05:19发布

How to clean react native project?

Is there any way to clean react native project as we can clean xcode project?

Any help will be appreciated!

6条回答
戒情不戒烟
2楼-- · 2019-06-18 05:33

React and node specific cleaning:

Remove node_modules to avoid inconsitence which may appear somehow rarely:

rm -rf node_modules

(reinstall if need with npm or yarn)

Clean npm cache if npm is used

npm cache clean

Clean react temp files:

rm -rf $TMP/react*
查看更多
放荡不羁爱自由
3楼-- · 2019-06-18 05:39

A react-native Project is about one XCode Project and one Android Project. (pure js code no need to do clean)

So what's you need would be

Clean XCode Project with

xcodebuild clean

And then clean Android Project with

./gradlew clean

You can simply write a batch file for it.

查看更多
我命由我不由天
4楼-- · 2019-06-18 05:43

remove android folder run

react-native upgrade

then

react-native run-android
查看更多
该账号已被封号
5楼-- · 2019-06-18 05:49

To reset react-native specific cache, run:

npm start -- --reset-cache

if in package.json you have

"scripts": {
  "start": "node node_modules/react-native/local-cli/cli.js start"
}
查看更多
ゆ 、 Hurt°
6楼-- · 2019-06-18 05:49

Clean the Android Project with:

cd android/
gradlew clean
查看更多
叛逆
7楼-- · 2019-06-18 05:58

For Android

cd android
gradlew clean

For IOS

cd ios
xcodebuild clean
查看更多
登录 后发表回答