yarn install 执行报错 install has been replaced with add,请教

第一次执行到这的时候报错
vagrant@homestead:~/code/weibo$ yarn add cross-env

错误:

warning " > sass-loader@7.1.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../parser/bin/babel-parser.js' -> '/home/vagrant/code/weibo/node_modules/@babel/core/node_modules/.bin/parser'".

接着按照以下步骤执行,

  • 1 $ rm -rf node_modules
  • 2 $ yarn config set registry http://registry.cnpmjs.org
  • 3 删除 packaging.json 中的 cross-env
  • 4 $ yarn install --no-bin-links
  • 执行到步骤3 yarn install --no-bin-links时,报错了:
  • error install has been replaced with add to add new dependencies. Run "yarn add -b -i -n -l -i -n -k -s" instead.
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

网上找了下,有说 执行这个的:yarn install --force,又说用npm install的,等,试过没作用。

请教大家怎么处理,是什么原因?感谢!

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
讨论数量: 2

已解决。推出并关闭虚拟机,重启电脑,成功!虽然还是不知道为什么。本意是5天没关机了,重启下顺便等人回复,结果意外运行 yarn install --no-bin-links成功了,有个警告不知道影不影响

vagrant@homestead:~/code/weibo$ yarn install --no-bin-links
yarn install v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "linux" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > sass-loader@7.1.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
Done in 369.81s.
vagrant@homestead:~/code/weibo$

4年前 评论

新建了个项目,开始就按照下面的顺序执行,仍在第3步报错,一样的错

1、删除 packaging.json 中的 cross-env

2、yarn install --no-bin-links

3、yarn run dev

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!