如何修复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。
我该如何卸载纱线?我已经将它用于反应本机项目,现在每当我移出代码index.ios.js
或者index.android.js
它抛出错误所以我只想使用npm但是每当我初始化一个react-native项目时它默认为yarn.我试过npm uninstall yarn
但是没用.谢谢.
有人可以告诉我,如何将纱线升级到最新版本?我在互联网上找到了,但可以找到一个正确的方法来做到这一点.谢谢.
在我的package.json
指向本地包my-custom-i18n
的相对路径:
"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
.
我的问题似乎与此问题类似,但它发生在我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) 我用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)
它说"找不到纱线包"
我必须做点别的事情,因为在文档中我没有看到任何关于它的东西.
谢谢.
我正在使用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进行全局安装具有预期的结果,一切正常.纱线缺少什么?
如果我的包有这些依赖项
{ "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)
和最近发布的版本baz
是2.1.0
,第一次运行yarn
将安装baz@2.1.0
在foobar/node_modules
.
如何强制纱线使用baz@2.0.9
包装foobar
?
我的理解是这可以使用npm shrinkwrap
(这个问题).
我的问题的摘要可能是:Yarn创建可重复的,确定性的安装,但我如何自定义该安装?
我的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)yarnpkg ×10
node.js ×5
npm ×5
build ×2
javascript ×2
ubuntu-16.04 ×2
node-sass ×1
package.json ×1
reactjs ×1
xcode ×1