标签: yarnpkg

找不到插件“提案数字分隔符”

如何修复Could not find plugin "proposal-numeric-separator",当我尝试构建我的 React 应用程序时出现此错误,我还没有弹出应用程序:

./src/index.js
Error: [BABEL] /home/pc/Downloads/project/src/index.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/home/pc/Downloads/project/node_modules/babel-preset-react-app/index.js$0")
    at Array.map (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)


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)

我尝试下载 Babel 和依赖 Proposal Numeric Separator,删除 Node Modules,清理 Yarn 缓存;但没有任何效果。

我使用的是 Yarn 1.22.4 和 Node 13.11.0,但我也尝试过 NPM 6.13.7。

build reactjs yarnpkg

99
推荐指数
10
解决办法
4万
查看次数

如何卸载纱线

我该如何卸载纱线?我已经将它用于反应本机项目,现在每当我移出代码index.ios.js或者index.android.js它抛出错误所以我只想使用npm但是每当我初始化一个react-native项目时它默认为yarn.我试过npm uninstall yarn但是没用.谢谢.

node.js yarnpkg

89
推荐指数
12
解决办法
12万
查看次数

如何使用终端升级纱线版本

有人可以告诉我,如何将纱线升级到最新版本?我在互联网上找到了,但可以找到一个正确的方法来做到这一点.谢谢.

ubuntu-16.04 yarnpkg

86
推荐指数
13
解决办法
7万
查看次数

什么时候使用纱线超过NPM?有什么区别?

Yarn和NPM有什么区别?在编写这个问题的时候,我只能在网上找什么展示就像一个NPM命令的纱线等同放着清单上的一些文章.

它们是否具有相同的功能(我知道Yarn会进行本地缓存,看起来您只需要下载一次包)但除此之外从NPM转移到Yarn有什么好处?

javascript npm yarnpkg

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

如何用Yarn安装本地路径的包?它无法找到包裹

在我的package.json指向本地包my-custom-i18n的相对路径:

的package.json

"dependencies": {
 "core-js": "^2.4.1",
 "my-custom-i18n": "./../MyProject.Shared/myproject-i18n",
 "rxjs": "5.0.0-beta.12",
 ...
}
Run Code Online (Sandbox Code Playgroud)

npm install正确安装包,但yarn有问题,只是找不到这个包:

纱线输出

$ yarn
yarn install v0.15.1
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find package "myproject-i18n" on the "npm" registry.
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.
Run Code Online (Sandbox Code Playgroud)

我看到它在npm注册表中看起来,这个包不存在.

使用当地包装纱线有什么变化吗?通过本地包我的意思是相对路径指向的包my-custom-i18n.

node.js npm yarnpkg

79
推荐指数
3
解决办法
4万
查看次数

错误:命名空间“std”中没有名为“remove_cv_t”的模板;你的意思是“remove_cv”?

我的问题似乎与问题类似,但它发生在我yarn install在 Rails 应用程序中运行时。

当我运行时yarn install,它成功运行了一段时间,然后

../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis]
        for (const auto numerator : numerators)
                        ^
../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
        for (const auto numerator : numerators)
             ^~~~~~~~~~~~~~~~~~~~~~
                        &
../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const std::__1::basic_string<char>' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-analysis]
        for (const auto denominator : denominators)
                        ^
../src/libsass/src/ast.hpp:1616:14: …
Run Code Online (Sandbox Code Playgroud)

xcode ruby-on-rails node.js node-sass yarnpkg

76
推荐指数
10
解决办法
2万
查看次数

安装Yarn Ubuntu 16.04(Linux Mint 18.1)

我用Ubuntu 16.04安装了新的Linux Mint 18.1.我已经安装了Node 6.10.0.

在执行指示Yarn文档的命令时:

sudo apt-get update && sudo apt-get install yarn
Run Code Online (Sandbox Code Playgroud)

它说"找不到纱线包"

我必须做点别的事情,因为在文档中我没有看到任何关于它的东西.

谢谢.

在此输入图像描述

node.js ubuntu-16.04 yarnpkg

72
推荐指数
3
解决办法
7万
查看次数

纱线全球命令不起作用

我正在使用Yarn v0.16.1.如果我理解正确(根据文档),yarn global add <package>应该相当于npm install -g <package>.但是,当我在docs(with create-react-app)中运行该示例时,该命令成功运行,但从命令行create-react-app无法使用.这是输出:

$ yarn global add create-react-app
$ yarn global v0.16.1
[1/4]   Resolving packages...
[2/4]   Fetching packages...
[3/4]   Linking dependencies...
[4/4]   Building fresh packages...
success Installed create-react-app@0.6.0 with binaries:
  - create-react-app
?  Done in 3.22s.
$ create-react-app --help
-bash: create-react-app: command not found
Run Code Online (Sandbox Code Playgroud)

使用npm进行全局安装具有预期的结果,一切正常.纱线缺少什么?

javascript npm yarnpkg

65
推荐指数
7
解决办法
4万
查看次数

如何用`yarn`覆盖嵌套的依赖项?

如果我的包有这些依赖项

{ "name": "my-package",
  "dependencies": { "foobar":"~1.0.3", "baz":"2.0.9" }
Run Code Online (Sandbox Code Playgroud)

并且foobar包具有这些依赖性

{ "name": "foobar",
  "dependencies": { "baz":"^2.0.0" }
Run Code Online (Sandbox Code Playgroud)

和最近发布的版本baz2.1.0,第一次运行yarn将安装baz@2.1.0foobar/node_modules.

如何强制纱线使用baz@2.0.9包装foobar

我的理解是这可以使用npm shrinkwrap(这个问题).


我的问题的摘要可能是:Yarn创建可重复的,确定性的安装,但我如何自定义该安装?

node.js npm npm-shrinkwrap yarnpkg

64
推荐指数
2
解决办法
2万
查看次数

找不到模块:错误:无法解析“ core-js / es6”

我的React应用程序的构建过程出现问题。

我总是收到以下错误:

找不到模块:错误:无法解析“ core-js / es6”

如果我在polyfill.js中使用它:

导入'core-js / es6';

那就是我的package.json:

{
  "name": "test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "private": true,
  "devDependencies": {
    "@babel/core": "^7.4.0",
    "@babel/preset-env": "^7.4.2",
    "@babel/preset-react": "^7.0.0",
    "@babel/runtime": "^7.4.2",
    "babel-loader": "^8.0.5",
    "babel-preset-es2015": "^6.24.1",
    "copy-webpack-plugin": "^5.0.2",
    "css-hot-loader": "^1.4.4",
    "eslint": "5.15.3",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-loader": "^2.1.2",
    "eslint-plugin-import": "2.16.0",
    "eslint-plugin-jsx-a11y": "6.2.1",
    "eslint-plugin-react": "7.12.4",
    "file-loader": "^3.0.1",
    "node-sass": "^4.11.0",
    "prettier": "^1.16.4",
    "react-hot-loader": "4.8.0",
    "sass-loader": "^7.1.0",
    "webpack": "^4.29.6",
    "webpack-cli": "^3.3.0",
    "webpack-dev-server": "^3.2.1"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "core-js": "^3.0.0",
    "prop-types": "^15.7.2",
    "react": "^16.8.5",
    "react-dom": …
Run Code Online (Sandbox Code Playgroud)

build npm package.json yarnpkg

64
推荐指数
10
解决办法
4万
查看次数