纱线警告:myCMS@0.0.1:没有许可证字段和许可证类型以及依赖性冲突

时间:2017-02-06 21:42:43

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

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

README.md表示在我克隆了回购后,执行yarn来构建所有内容。以下是导致这一点的命令:

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

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

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这两个版本中的较大版本(假设这在代码中有效),这会阻止此错误消息吗?

1 个答案:

答案 0 :(得分:0)

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

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