【问题标题】:Yarn warning: myCMS@0.0.1: No license field and type of license plus dependency conflict纱线警告:myCMS@0.0.1:没有许可证字段和许可证类型加上依赖冲突
【发布时间】:2017-02-06 21:42:42
【问题描述】:

我在 Vagrant(Laravel 平台,如果相关)中运行 Ubuntu 14.x 和客户端的 CMS。请原谅范围的广泛性,因为使用包和依赖项对我来说是新事物,让我头晕目眩,我需要基本上沉浸在这些概念中,这样我才能理解它们。也就是说,从我看到的帖子数量来看,其他开发者似乎面临着同样的挑战。

README.md 说在我克隆 repo 后执行 yarn 来构建所有内容。以下是导致该点的命令:

which nodejs # /usr/bin/nodejs
nodejs -v # v4.7.3
npm install -g yarn #this installed yarn v0.19.1
yarn

我得到以下序列,每次我尝试运行 yarn 时,都会出现以下错误。有趣的是,在 4 次中的第 2 次我尝试它引用了一个不同的符号链接,很抱歉这样的长度:

root@vagrant-ubuntu-trusty-64:/var/www/mycms# yarn
yarn install v0.19.1
warning mycms@0.0.1: No license field
warning mycms@0.0.1: "dependencies" has dependency "babel-polyfill" with range "^6.16.0" that collides with a dependency in "devDependencies" of the same name with version "^6.7.4"
warning mycms@0.0.1: "dependencies" has dependency "babel-preset-es2015" with range "^6.18.0" that collides with a dependency in "devDependencies" of the same name with version "^6.6.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../babylon/bin/babylon.js' -> '/var/www/mycms/node_modules/babel-core/node_modules/.bin/babylon'".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/mycms/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

root@vagrant-ubuntu-trusty-64:/var/www/mycms# yarn
yarn install v0.19.1
warning mycms@0.0.1: No license field
warning mycms@0.0.1: "dependencies" has dependency "babel-polyfill" with range "^6.16.0" that collides with a dependency in "devDependencies" of the same name with version "^6.7.4"
warning mycms@0.0.1: "dependencies" has dependency "babel-preset-es2015" with range "^6.18.0" that collides with a dependency in "devDependencies" of the same name with version "^6.6.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../normalize-package-data/node_modules/semver/bin/semver' -> '/var/www/mycms/node_modules/accord/node_modules/.bin/semver'".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/mycms/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

root@vagrant-ubuntu-trusty-64:/var/www/mycms# yarn
yarn install v0.19.1
warning mycms@0.0.1: No license field
warning mycms@0.0.1: "dependencies" has dependency "babel-polyfill" with range "^6.16.0" that collides with a dependency in "devDependencies" of the same name with version "^6.7.4"
warning mycms@0.0.1: "dependencies" has dependency "babel-preset-es2015" with range "^6.18.0" that collides with a dependency in "devDependencies" of the same name with version "^6.6.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../babylon/bin/babylon.js' -> '/var/www/mycms/node_modules/babel-core/node_modules/.bin/babylon'".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/mycms/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

root@vagrant-ubuntu-trusty-64:/var/www/mycms# yarn  # 
yarn install v0.19.1
warning mycms@0.0.1: No license field
warning mycms@0.0.1: "dependencies" has dependency "babel-polyfill" with range "^6.16.0" that collides with a dependency in "devDependencies" of the same name with version "^6.7.4"
warning mycms@0.0.1: "dependencies" has dependency "babel-preset-es2015" with range "^6.18.0" that collides with a dependency in "devDependencies" of the same name with version "^6.6.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../babylon/bin/babylon.js' -> '/var/www/mycms/node_modules/babel-core/node_modules/.bin/babylon'".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/mycms/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

我有两个问题希望简洁:

  • 如何摆脱mycms@0.0.1: No license field(这很关键)?
  • 如何解决dependenciesdevDependencies 之间的冲突?我在开发环境中工作,但显然不想接触yarn.lock(?) 文件。
  • 如果我对dependenciesdevDependencies 都使用了两个版本中的较大者(假设这在代码中有效),这是否可以防止出现此错误消息?

【问题讨论】:

    标签: node.js dependency-management yarnpkg conflicting-libraries


    【解决方案1】:

    https://docs.npmjs.com/files/package.json#license 将帮助您解决No license field 错误。

    关于不同的依赖关系,您应该只需要 devDependencies 部分中的 babel-polyfillbabel-preset-es2015

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-08
      • 1970-01-01
      • 1970-01-01
      • 2021-07-27
      • 1970-01-01
      • 2018-12-22
      • 2018-02-13
      • 2016-10-03
      相关资源
      最近更新 更多