小编THI*_*NIS的帖子

找不到模块 coa/compile.js

我在使用 create-react-app 创建的项目中运行纱线,但收到此错误:

Exit code: 1
Command: start /B node compile.js & node compile.js
Arguments: 
Directory: uber-web/node_modules/coa
Output:
/bin/sh: 1: start: not found
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'uber-web/node_modules/coa/compile.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
Run Code Online (Sandbox Code Playgroud)

我已经卸载了所有 .lock 和 node_module 文件夹,但它仍然不起作用。

node.js create-react-app yarnpkg

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

使用 Reactjs 更改路线时屏幕闪烁

我有一个简单的路由系统,其中有一个页面作为容器 ( Home Page),其中有两个部分(NewPageStoredPage).

\n

我将所有路由设置保留在一处,即 App.tsx 中。我这样做是为了保持集中并获得更好的控制(我不知道我是否做错了)。

\n

发生的问题是,当更改该部分时,它会闪烁,由于某种原因它会再次重新加载页面。

\n

注意:我使用react-router-guards

\n

应用程序TSX

\n
import HomePage from \'pages/HomePage\';\nimport StoredPage from \'pages/StoredPage\';\nimport { memo, useMemo } from \'react\';\nimport { BrowserRouter, Switch, Redirect } from \'react-router-dom\';\nimport { GuardedRoute, GuardProvider, Next } from \'react-router-guards\';\nimport { GuardFunctionRouteProps, GuardToRoute } from \'react-router-guards/dist/types\';\n\nexport const Main = memo(() => {\n    const RequireLoginGuard = (to: GuardToRoute, from: GuardFunctionRouteProps | null, next: Next) => next();\n\n    return (\n        <ErrorBoundary instance={instance}>\n            <BrowserRouter>\n                <GuardProvider guards={[RequireLoginGuard]} …
Run Code Online (Sandbox Code Playgroud)

reactjs react-router-dom

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

如何通过 Github Actions 和 Monorepo 使用子文件夹?

它有一个 monorepo,其中包含两个子文件夹,它们是:

文件夹

每个都有各自的项目和包。我正在尝试访问某个子文件夹以执行其各自的操作,但当我运行命令来使用 lint 进行测试时,它给出了错误,即:

error Couldn't find a package.json file in "/github/workspace"
Run Code Online (Sandbox Code Playgroud)

它可能不应该访问前端子文件夹。我需要它来运行该子文件夹中的所有命令,我该怎么做?

我的.YML

name: PIPELINE OF TESTS

on:
  push:
    branches: [frontend-develop, backend-develop]
  pull_request_target:
    types: [opened, edited, closed]
    branches: [main]

jobs:
  test-frontend:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./frontend
    strategy:
      matrix:
        node-version: [14.x]
        architecture: [x64]
    steps:
      - name: CHECK-OUT GIT REPOSITORY
        uses: actions/checkout@v2

      - name: USE NODEJS ${{ matrix.node-version }} - ${{ matrix.architecture }}
        uses: actions/setup-node@v2

      - name: INSTALL PROJECT DEPENDENCIES (YARN)
        uses: borales/actions-yarn@v2.0.0
        with:
          cmd: install

      - …
Run Code Online (Sandbox Code Playgroud)

github-actions

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

使用 STYLELINT 找不到与模式匹配的文件

我刚刚安装STYLELINT并按照文档进行操作,但遇到了以下问题:

$ npx stylelint --config ./stylelintrc './**/*.tsx'
Error: No files matching the pattern "'./src/**/*.tsx'" were found.
    at standalone (C:\Users\thiag\OneDrive\Documentos\PROJETOS\sugar\node_modules\stylelint\lib\standalone.js:273:43)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
Run Code Online (Sandbox Code Playgroud)

这是我的层次结构:

在此输入图像描述

这是我的代码.stylelintrc

{
    "processors": ["stylelint-processor-styled-components"],
    "extends": ["stylelint-config-recommended", "stylelint-config-styled-components"],
    "customSyntax": "postcss-scss",
    "rules": { // BAR }
}
Run Code Online (Sandbox Code Playgroud)

封装代码:

{
    "scripts": {
        "start": "expo start",
        "android": "expo start --android",
        "ios": "expo start --ios",
        "web": "expo start --web",
        "eject": "expo eject",
        "stylelint:check": "stylelint-config-prettier-check",
        "stylelint:css": "npx stylelint './**/*.{tsx, ts}'",
        "prepare": "husky …
Run Code Online (Sandbox Code Playgroud)

stylelint styled-components expo

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