在我项目的根文件夹中, bower.json 和 package.json 都存在。
当使用 npm 时,我会分别安装npm和bower安装。现在我切换到 Yarn 。我的问题是,当我进行纱线安装时会发生什么?
将从package.json和bower.json中获取所有依赖项 设置?
请帮忙。
答案 0 :(得分:0)
Yarn现在决定放弃Bower的支持。纱线不会看你的bower.json。除了bower install
之外,您需要yarn
。
答案 1 :(得分:0)
较新的文章https://bower.io/blog/2017/how-to-migrate-away-from-bower/解释了如何将依赖关系从凉亭转移到纱线
本文中提到的工具bower-away会将您的bower.json
内容转换为package.json
格式(可能需要运行几次才能解析所有依赖项)然后可以与Yarn / npm /...
根据我的理解,纱线仍然没有看bower.json
如果您喜欢我,并且将npm软件包安装在另一个目录中以打包软件包,则可以尝试npm install --prefix
或yarn install --modules-folder
。对于Yarn,使用的文件夹将替换node_modules
,但请务必阅读https://github.com/yarnpkg/yarn/issues/1684