我在使用 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 文件夹,但它仍然不起作用。
我有一个简单的路由系统,其中有一个页面作为容器 ( Home Page),其中有两个部分(NewPage和StoredPage).
我将所有路由设置保留在一处,即 App.tsx 中。我这样做是为了保持集中并获得更好的控制(我不知道我是否做错了)。
\n发生的问题是,当更改该部分时,它会闪烁,由于某种原因它会再次重新加载页面。
\n注意:我使用react-router-guards
\n应用程序TSX
\nimport 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) 它有一个 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) 我刚刚安装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)