小编Hay*_*yan的帖子

npm 注册表似乎有问题(返回未定义)。重试

我正在尝试在我的项目中安装依赖项,但是当我运行时yarn install出现以下错误

\n
[2/5]   Resolving packages...\ninfo There appears to be trouble with the npm registry (returned undefined). Retrying...\ninfo There appears to be trouble with the npm registry (returned undefined). Retrying...\ninfo There appears to be trouble with the npm registry (returned undefined). Retrying...\ninfo There appears to be trouble with the npm registry (returned undefined). Retrying...\n\xe2\xa0\x81 axios@0.21.1/usr/local/Cellar/yarn/1.22.10/libexec/lib/cli.js:66965\n            throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode);\n            ^\n\nResponseError: Request failed "502 Bad Gateway"\n    at ResponseError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.22.10/libexec/lib/cli.js:696:66)\n    at new ResponseError (/usr/local/Cellar/yarn/1.22.10/libexec/lib/cli.js:802:124)\n    at Request.params.callback [as …
Run Code Online (Sandbox Code Playgroud)

npm reactjs npm-install yarnpkg yarn-workspaces

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

类型 'typeof import("...")' 中缺少属性 'default',但类型 '{ default: ComponentType<any>; 中需要属性 'default' }'

当我尝试使用以下命令将一个 React 组件导入另一个组件时出现 TypeScript 错误React.lazy

模板/BugReport/index.tsx

import { useEffect, useContext } from 'react';
import BugReportStatic from '@tamm/ui-lib-v2-bug-report';
import baseUrl from 'client/utils/baseUrl';
import { StoreContext } from 'client/services/context';

function BugReport() {
  const store = useContext(StoreContext);
  useEffect(() => {
    BugReportStatic.init({
      bugReportIntegrationApi: `${baseUrl}/pub/feedback/bugReport`,
      store,
      isStore: !!store,
    });
    return () => {
      BugReportStatic.destroy();
    };
  }, []);
  return null;
}

export default BugReport;
Run Code Online (Sandbox Code Playgroud)

模板/页脚/index.tsx

const BugReport = lazy(() =>
  import(/* webpackChunkName: "bug-report" */ 'client/templates/BugReport'),
);
Run Code Online (Sandbox Code Playgroud)

Footer尽管我有默认导出,但我收到 TypeScript 错误BugReport

Type 'Promise<typeof import("/Users/hayksimonyan/Desktop/JTUpdates/dcd/src/client/templates/BugReport/index")>' is …
Run Code Online (Sandbox Code Playgroud)

import typescript reactjs react-typescript react-lazy-load

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

运行子进程 npm 时出错。离子启动

我尝试开始一个新的离子项目。我做了这些步骤

1.npm install -g @ionic/cli

2.离子启动

我得到了与 npm 相关的错误。我搜索但找不到解决方案。

npm WARN 已弃用 request@2.88.2:请求已被弃用,请参阅https://github.com/request/request/issues/3142 npm WARN registryhttps://registry.npmjs.org/ 的意外警告:杂项警告 EINTEGRITY :想SHA512-F4TxbIf2Zho1u0gkwk7pMZkuAOcjie2Ifj9Txahek0JAUamP58o + 0YUlXp2xApo68CRZSFS4nMA5h897G2Q93A ==但得到SHA512-T7rpJR5srgZoHOMh8Kv1DDE6mbnW43SNUk9aRhPXGCfF2iJZoTEItjVYHC / gvtncRQCksb8Tk6f72HLaB6la0A ==:SHA512,F4TxbIf2Zho1u0gkwk7pMZkuAOcjie2Ifj9Txahek0JAUamP58o + 0YUlXp2xApo68CRZSFS4nMA5h897G2Q93A ==完整性校验和使用SHA512时失败。(50573 字节)npm WARN 注册表使用来自https://registry.npmjs.org/ 的陈旧数据由于重新验证期间的请求错误。npm WARN deprecated core-js@2.6.11: core-js@<3 不再维护,由于问题数量不推荐使用。请将您的依赖项升级到 core-js@3 的实际版本。npm 错误!cb() 从未调用过!

npm 错误!这是 npm 本身的错误。请在以下位置报告此错误:npm ERR! https://npm.community

npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!C:\Users\Admin\AppData\Roaming\npm-cache_logs\2020-05-05T06_02_58_568Z-debug.log [ERROR] 运行子进程 npm 时出错。

npm reactjs ionic-framework ionic4

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