小编TCS*_*TCS的帖子

无效的“Podfile”文件:无法加载此类文件

我正在进入 ios 文件夹并使用“pod install”命令。

和下面的错误

[!] Invalid `Podfile` file: cannot load such file -- /Users/blabla/works/blabla-app/node_modules/react-native/scripts/react_native_pods.

  from /Users/blabla/works/blabla-app/ios/Podfile:2
   -------------------------------------------
   require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
   require_relative '../node_modules/react-native/scripts/react_native_pods'
   
   -------------------------------------------
Run Code Online (Sandbox Code Playgroud)

我删除了 node_modules 文件夹,删除了 package-lock.json 并使用了“npm install”命令。我删除了cocoapods并重新安装。

没有什么对我有用。

我的 package.json 文件如下(仅包而不是全部)

"@codler/react-native-keyboard-aware-scroll-view": "^1.0.1",
"axios": "^0.19.0",
"entities": "^2.1.0",
"expo": "^38.0.8",
"expo-cli": "^3.28.5",
"native-base": "github:Healthyco/NativeBase#feature/fix-request-animation",
"native-base-autocomplete": "^1.3.2",
"prop-types": "^15.7.2",
"react": "16.9.0",
"react-native": "0.62.0",
"react-native-camera": "^3.40.0",
"react-native-camera-hooks": "^0.3.1",
"react-native-chart-kit": "^6.7.0",
"react-native-daterange-picker": "^1.4.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-keyboard-aware-scroll-view": "https://github.com/APSL/react-native-keyboard-aware-scroll-view#fb40649a9c84aa23d6a55355e9e0e432795967a6",
"react-native-keyboard-aware-scrollview": "^2.1.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-masked-text": "^1.13.0",
"react-native-modal": "^11.5.6",
"react-native-safe-area-context": "~3.0.7",
"react-native-screens": "^2.7.0",
"react-native-svg": "^12.1.0",
"react-native-swipe-list-view": …
Run Code Online (Sandbox Code Playgroud)

react-native

8
推荐指数
1
解决办法
2万
查看次数

React Swiper 导航不工作如何工作?

致力于 Swiper 反应组件。但导航或其他任何东西都不起作用。

https://swiperjs.com/react

        <Swiper
          // install Swiper modules
          modules={[Navigation, Pagination, Scrollbar, A11y]}
          spaceBetween={50}
          slidesPerView={1}
          navigation={true}
          pagination={{ clickable: true }}
          className="mySwiper"
        >
        {banners.map((item, i) => (
          <SwiperSlide>
            <div className="slider-single">
              blabla
            </div>
          </SwiperSlide>
        ))}
      </Swiper>
Run Code Online (Sandbox Code Playgroud)

这是我上面的代码。导航箭头出现。但是当我单击它们时,它不会移动到下一张幻灯片。(当我拖动它时,它会移动到下一个)

reactjs swiper.js

4
推荐指数
1
解决办法
2万
查看次数

Laravel API 响应 - 重定向到登录页面

这是我经过身份验证的中间件:

<?php

namespace App\Http\Middleware;

use Illuminate\Auth\Middleware\Authenticate as Middleware;

class Authenticate extends Middleware
{
    /**
     * Get the path the user should be redirected to when they are not authenticated.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return string|null
     */
    protected function redirectTo($request)
    {
        if ($request->expectsJson()){
            return response()->json(['message' => "Token is expired"], 401);
        }
        if (! $request->expectsJson()) {
            return route('login');
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的 api.php

 Route::middleware(['auth:api'])->prefix('notifications')->namespace('Notification')->group(function () {
        Route::post('/send', 'NotificationController@send');
    });
Run Code Online (Sandbox Code Playgroud)

我使用邮递员发送带有标题内容类型 JSON 的请求。但它总是重定向到主页。没有 JSON 格式的答案。

这有什么问题吗?

我已经失去理智了。

laravel

4
推荐指数
1
解决办法
6190
查看次数

'ReporteRs' 不可用

我正在尝试安装一个名为“ReporteRs”的包,但它给了我这样的错误:“install.packages 中的警告:包 'ReporteRs' 不可用(对于 R 版本 3.4.4)”

我的 R 版本是 3.4.4。这是我的安装代码;

cran_dir_url <- "https://cran.r-project.org/src/contrib/Archive/ReporteRs/ReporteRs_0.8.9.tar.gz"

install.packages("ReporteRs", contriburl=cran_dir_url,
                 repos = cran_dir_url, 
                 type = 'source',
                 INSTALL_opts = "--no-multiarch")
Run Code Online (Sandbox Code Playgroud)

r package

2
推荐指数
1
解决办法
2126
查看次数

Expo - 如何制作自定义权限消息

当我尝试到达用户的相机时,我需要更改相机消息。

它返回默认的“允许 xx 使用您的相机”消息,我想用我自己的权限消息更改它。

在哪里更改以及如何更改?

下面是我的相机代码。

  useEffect(() => {
    (async function () {
      const { status } = await Camera.requestPermissionsAsync()
      setHasPermission(status === 'granted')
    })()
  }, [])
Run Code Online (Sandbox Code Playgroud)

react-native expo

1
推荐指数
1
解决办法
2014
查看次数

NextJs 未使用的 Javascript

我在 vercel 上使用 nextjs 。

在我的主页上进行谷歌灯塔页面速度测试。

它返回“删除未使用的 javascript”,并列出我的其他 staticprops 页面的 javascript 文件,例如;

privacy-policy.js
gdpr.js
shopping-cart.js etc.
Run Code Online (Sandbox Code Playgroud)

为什么它加载其他页面,而我不在这些页面上?我怎样才能阻止它?它们必须仅在其自己的 url 处加载。

next.js

1
推荐指数
1
解决办法
2473
查看次数

标签 统计

react-native ×2

expo ×1

laravel ×1

next.js ×1

package ×1

r ×1

reactjs ×1

swiper.js ×1