最佳答案
鉴于这种 package.json
:
{
"name": "yarn-install-fail",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"author": "",
"license": "ISC",
"dependencies": {
"aws-sdk": "2.x.x",
"s3-streams": "^0.3.0"
}
}
我可以通过 npm 成功地安装依赖项:
$ npm install
added 27 packages in 1.844s
然而,这种说法失败了:
$ yarn install
yarn install v0.24.5
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
error s3-streams@0.3.0: The engine "node" is incompatible with this module. Expected version "^1.2.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
看起来纱线在安装程序库 s3-streams@0.3.0
时遇到了麻烦,但是我认为它会像 npm
一样退回来安装所有的依赖项。