2

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

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

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(这很关键)?
  • 如何解决 和 之间的dependencies冲突devDependencies?我在开发环境中工作,但显然不想触摸yarn.lock(?) 文件。
  • 如果我对两者都使用了两个版本中的较大者(假设dependenciesdevDependencies在代码中有效),这会阻止此错误消息吗?
4

1 回答 1

0

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

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

于 2017-05-18T17:16:05.387 回答