由于参数@shoutem/ui有限制,ref我添加了一个补丁,以通过添加以下内容来尊重 ref 实现ref={(input) => this.props.inputRef(input)}:
该团队最终没有使用这条路径,而是创建了一种不同的方法来解决该问题。我想回滚这个补丁。我找不到删除补丁的方法,就像添加补丁一样简单。我已经检查了文档,但找不到有关它的详细信息。
我也尝试过:
yarn patch-package package-name --reverse
Run Code Online (Sandbox Code Playgroud)
检查此处文档的“选项”--reverse标题下的https://yarnpkg.com/package/patch-package。
前任。:yarn patch-package @shoutem/ui --reverese
即使在那之后,当我运行时yarn install,我也会在我的补丁列表(检查图像)中看到我想要删除的内容。
对于上下文,我尝试对此问题应用解决方法:https://github.com/TooTallNate/node-proxy-agent/issues/62
该库中的打字稿无法编译,错误是node_modules/https-proxy-agent/dist/agent.d.ts:2:8 - error TS1192: Module '"net"' has no default export.“这阻止了我自己的代码编译”。解决方法是将其放在我的 tsconfig.json 中:
"allowSyntheticDefaultImports": true
Run Code Online (Sandbox Code Playgroud)
我不希望这适用于我的所有代码,只是这个库/所有node_modules。如何仅为我的 node_modules 打开此设置?
我第一次尝试在本地运行旧版 React 应用程序。我使用的是装有 Big Sur 11.5.2 的新 Mac M1。我的节点版本是 16.9.0,我将 python3 设置为默认值(尽管该应用程序似乎正在寻找 python2)。我还将 CommandLineTools 升级到了最新版本。
但是当我做一个简单的操作时npm install,我收到很多警告,最后出现这个错误:
npm ERR! /Users/cd/.node-gyp/16.9.0/include/node/v8-internal.h:489:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ~~~~~^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
npm ERR! template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error …Run Code Online (Sandbox Code Playgroud) 每当我在新计算机上的项目上运行“npm install”命令时,都会出现一些奇怪的行为。安装命令完成后,我的 node_modules 文件夹就会消失。任何帮助表示赞赏!
这是日志:
PS C:\Dev\eth> npm i
npm WARN deprecated truffle-hdwallet-provider@0.0.3: WARNING: This package has been renamed to @truffle/hdwallet-provider.
npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm …Run Code Online (Sandbox Code Playgroud) 我使用 Puppeteer 进行网页抓取,并使用我制作的一个小型 NodeJs Web 应用程序。这个网络应用程序托管在 Heroku 上并且可以jontewks/puppeteer-heroku-buildpack正常工作。
我面临的问题是,由于 Heroku 大小限制,我的应用程序不再构建:
Compiled slug size: 537.4M is too large (max is 500M).
Run Code Online (Sandbox Code Playgroud)
我尝试过几件事:
interactive_ui_tests.exe
headless_shell而不是 Chromium
puppeteer-extra和 之类的东西puppeteer-extra-plugin-stealth,所以改变它很麻烦locales
2.1.1),它使用旧版本的 Chromium,稍微轻一些
heroku repo:gc -a …“依赖关系”:{“@react-native-community/masked-view”:“0.1.10”,“@react-navigation/native”:“^ 5.8.10”,“@react-navigation/stack”:“ ^5.12.8", "expo": "^44.0.1", "expo-status-bar": "~1.2.0", "react": "^16.13.1", "react-dom": " 16.13.1", "react-native": "^0.64.3", "react-native-gesture-handler": "~2.1.0", "react-native-paper": "^4.11.1", “react-native-reanimated”:“~2.3.1”,“react-native-safe-area-context”:“3.3.2”,“react-native-screens”:“~3.10.1”,“react -native-status-bar-height": "^2.6.0", "react-native-web": "~0.13.12" },
我在尝试为 React 应用程序运行“npm start”时遇到了一个错误。
我的应用程序在开发过程中基本上按照我的预期运行,但是我遇到了一个错误,需要我更新我的节点版本作为潜在的修复。我将 node 更新到 v16.13.2,并且还决定将 npm 更新到 v8.3.2。现在,当尝试运行 npm start 时,我收到以下错误。我还发现奇怪的是引用的文件不是来自我当前项目文件夹中的目录。
到目前为止我已经尝试过以下操作:
我想知道是否有人可以帮忙解决?
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'react'
Require stack:
- C:\Users\shane\AppData\Roaming\npm\node_modules\react-scripts\scripts\start.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at Object.<anonymous> (C:\Users\shane\AppData\Roaming\npm\node_modules\react-scripts\scripts\start.js:52:31)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\shane\\AppData\\Roaming\\npm\\node_modules\\react-scripts\\scripts\\start.js'
]
}
Run Code Online (Sandbox Code Playgroud)
包.json
{
"name": "faucet", …Run Code Online (Sandbox Code Playgroud) 我有一个 React 项目,其中包含相当多的组件,我想安装 StoryBook 以便能够查阅它们。
为此,我将 StoryBook 作为主项目之外的项目安装,保留文件夹结构如下:
c:\development\MyProject
c:\development\StoryBook
Run Code Online (Sandbox Code Playgroud)
在 StoryBook 内部,我在Button.stories.jsx文件中添加了以下“导入” ,该文件管理安装中默认提供的按钮部分。
import SmallButton from 'MyProject/Buttons/SmallButton';
Run Code Online (Sandbox Code Playgroud)
为了使其工作并能够导入我的组件,我在StoryBook 项目内的node_modules文件夹内创建了一个符号链接。
c:\development\StoryBook\node_modules\MyProject <== symbolic link to c:\development\MyProject\src
Run Code Online (Sandbox Code Playgroud)
当我使用纱线故事书启动 StoryBook 时,它找到我的组件文件,但出现以下我无法解决的错误:
ERROR in ../MyProject/src/components/VSNButtons/SmallButton/index.js 10:12
Module parse failed: Unexpected token (10:12)
File was processed with these loaders:
* ./node_modules/@storybook/preset-create-react-app/node_modules/@pmmmwh/react-refresh-webpack-plugin
/loader/index.js
You may need an additional loader to handle the result of these loaders.
| const className = "ep-action " + (this.props.disabled ? "disabled " : " ") + …Run Code Online (Sandbox Code Playgroud) 我尝试删除node_modules并重新安装它,但它不起作用。该项目运行良好,直到出现以下错误:
ERROR in ./node_modules/cookie-signature/index.js 4:13-30
Module not found: Error: Can't resolve 'crypto' in '/home/juandav/react-app-store/my-store/node_modules/cookie-signature'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use …Run Code Online (Sandbox Code Playgroud) *.ts我在使用 ts-node运行文件时遇到问题。
我的项目的目录结构如下所示。
-- project dir
-- src
-- services
-- module1
-- file1.ts (classA)
-- file2.ts (classB)
-- index.ts (contains export statements like export * from file1.ts)
-- application.ts
Run Code Online (Sandbox Code Playgroud)
这是我在tsconfig.json文件中配置的内容。
{
"compilerOptions": {
"lib": [
"es2020",
"dom"
],
"baseUrl": ".",
"paths": {
"@src/*": ["src/*"],
"@tests/*": ["tests/*"],
},
"module": "CommonJS",
"target": "es2020",
"strict": true,
"alwaysStrict": true,
"declaration": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"inlineSourceMap": true,
"inlineSources": …Run Code Online (Sandbox Code Playgroud) node-modules ×10
node.js ×6
javascript ×3
npm ×3
reactjs ×3
typescript ×3
react-native ×2
chromium ×1
heroku ×1
node-sass ×1
npm-install ×1
patch ×1
puppeteer ×1
storybook ×1
ts-node ×1
tsconfig ×1
yarnpkg ×1