我只是将脚趾浸入 JHipster,我发现在生成新项目时收到了很多警告。他们似乎都以这个“源地图”项目为中心。
warning Resolution field "source-map@0.6.1" is incompatible with requested version "source-map@^0.5.6"
Run Code Online (Sandbox Code Playgroud)
我收到 27 行不同版本号的警告。
该项目仍然成功构建并运行。
这里发生了什么?
泰
我正在尝试运行一个纱线服务器
$ yarn run start --https
Run Code Online (Sandbox Code Playgroud)
它启动一个服务器,但使用的是 http 而不是 https。--https 选项适用于我正在开发的另一个项目,但不适用于这个项目。我想知道是否还需要在 package.json 中设置一些内容来启用 https。作为参考,这是我克隆并正在使用的 github 项目: https: //github.com/googlecreativelab/teachable-machine-boilerplate。
我使用 yarn v1.6.0作为依赖管理器,我使用以下命令全局安装了 live-server:
yarn global-add live-server
但是当执行它时live server,它给出了以下错误:
'live-server' 不是内部或外部命令,也不是可运行的程序或批处理文件。
很明显我的路径没有配置可以帮助我应该使用哪个路径环境变量?
我已经jhipster-generator使用yarn.
今天,我需要卸载这个版本,以便从5.1.0版本降级到5.0.1版本。
尝试时:
yarn global remove jhispter
Run Code Online (Sandbox Code Playgroud)
我收到一条错误消息:
yarn global v1.7.0
[1/2] Removing module jhispter@5.1.0...
error This module isn't specified in a manifest.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
Run Code Online (Sandbox Code Playgroud)
卸载generator-jhipster的正确方法是什么?
如果yarn.lock积累了一堆旧的中间依赖项,其中一些在添加新的依赖项时可能会继续存在,那么清理它们的可靠方法是什么?
当我运行 yarn start 时,我得到以下输出
$ yarn start
yarn run v1.15.2
$ react-app-rewired start
The "injectBabelPlugin" helper has been deprecated as of v2.0. You can use customize-cra plugins in replacement - https://github.com/arackaf/customize-cra#available-plugins
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Run Code Online (Sandbox Code Playgroud)
我尝试在以下位置阅读文档:https : //github.com/arackaf/customize-cra#available-plugins但由于我是 React 和 npm 的新手,这对我来说没有多大意义,我不知道是哪个用插件替换已弃用的助手
我的config-overrides.js样子:
const { injectBabelPlugin } = require('react-app-rewired');
const rewireLess = require('react-app-rewire-less');
module.exports = function override(config, env) {
config = injectBabelPlugin(['import', { libraryName: 'antd', …Run Code Online (Sandbox Code Playgroud) 我的应用程序上的yarn.lock 文件中的js-yaml 存在高严重性的git hub 安全漏洞rails。
Remediation
Upgrade js-yaml to version 3.13.1 or later. For example:
js-yaml@^3.13.1:
version "3.13.1"
Run Code Online (Sandbox Code Playgroud)
我已经运行yarn upgrade js-yaml它更新了我的 package.json 中的版本: "js-yaml": "^3.13.1",
然而这个问题仍然出现在github上。
我还尝试删除yarn.lock并运行yarn install以及使用重复数据删除工具yarn-deduplicate ./yarn.lock(该工具在其他情况下对我有用)。但是,它的古老性仍然存在。
这是 js-yaml 在我的yarn.lock 文件中的样子:
js-yaml@^3.12.0, js-yaml@^3.13.1:
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
js-yaml@~3.7.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80"
integrity sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=
dependencies:
argparse "^1.0.7"
esprima "^2.6.0"
Run Code Online (Sandbox Code Playgroud)
我想知道:
如何解决这个特定问题
保持yarn.lock 文件最新以避免安全漏洞的最佳实践是什么。看来我不是唯一一个遇到重复问题的人yarn upgrade(例如https://github.com/yarnpkg/yarn/issues/3967),也许我可以做一些不同的事情?
在尝试查找TRUE向量中的多个值时,我遇到了第一个 Google点击.但是,这并不完全符合我的要求.我有兴趣TRUE在第一个之前找到向量中的值的数量(FALSE如果有的话).我有一个向量a <- c(TRUE,TRUE,TRUE,FALSE,TRUE, TRUE),想要在TRUE之前找到所有值FALSE,因此输出将为3.请注意,如果TRUE向量中只有值,它也应该有效.
我正在使用 npm 和 YARN 来管理项目的依赖项。正如这个问题所建议的:How do I add comments to package.json for npm install? 我使用以下格式以便能够在 pacakge.json 中包含注释。这是一个示例:
"scripts": {
"////":"LIVE BROWSER RELOAD",
"serve:patternlab": "BUILD_TO='patternlab' browser-sync start --config browsersync.config.js",
"serve:site": "browser-sync start --config browsersync.config.js",
"////":"LINTING COMMANDS",
"lint:js": "eslint $npm_package_config_src_js --ignore-pattern **/vendor/**/*.js || true",
"lint:css": "sass-lint $npm_package_config_src_css**/*.scss -v -q || true",
"lint": "npm-run-all -p lint:js lint:css",
}
Run Code Online (Sandbox Code Playgroud)
这种格式可以很容易地看到每组脚本正在做什么。但是,每当我运行yarn add添加新包时,它都会删除除最后一个注释(移到对象顶部scripts)之外的所有注释,并删除换行符。我可以做些什么来避免这种情况发生吗?
yarnpkg ×8
npm ×4
jhipster ×2
node.js ×2
reactjs ×2
antd ×1
deeplearn.js ×1
javascript ×1
r ×1
windows ×1