--save " 的等效项是什么来更新我的 package.json 文件中的条目?我可以在这里使用“npm install
I am using Yarn to install the dependencies of my project. What is the equivalent of "npm install <package_name> --save " in Yarn to update the entry in my
The yarn equivalent to
Here's the link to the docs for the full list of commands in comparison to
Using --dev or -D will install one or more packages in your devDependencies.
Use the following command :
Comparing npm and Yarn Commands
Install dependencies
Install a package
Install a package globally
Install a package as a development dependency
Uninstall a package
Uninstall a package globally
Uninstall a development dependency package
Update the dependencies
Update a package
Create a new package
Run a script defined in the package.json
Test a package
Publish a package
Remove all data from the cache
Success story sharingpackage.json
file? I can use "npm install <package_name> --save " here, but I want to use Yarn as much as possible to improve performance and avoid confusion between npm and Yarn.
npm install <name> --save
is:
yarn add <name>
npm
.
yarn add <package...> [--dev/-D]
yarn add [package_name]
npm install => yarn
npm install [package_name] => yarn add [package_name]
npm install -g [package_name] => yarn global add [package_name]
npm install --save-dev [package_name] => yarn add --dev [package_name]
npm uninstall [package_name] => yarn remove [package_name]
npm uninstall -g [package_name] => yarn global remove [package_name]
npm uninstall --save-dev [package_name] => yarn remove [package_name]
npm update => yarn upgrade
npm update [package_name] => yarn upgrade [package_name]
npm init => yarn init
npm run => yarn run
npm test => yarn test
npm publish => yarn publish
npm cache clean => yarn cache clean
Follow WeChat
Want to stay one step ahead of the latest teleworks?
Subscribe Now
相似问题
npm install [package]
, while it'snpm install --save [package]
in fact.--save
flag is not required anymore when using npm. If you don't want npm to save we now have to usenpm --no-save
:)save
option disabled globally in order for NPM to be consistent between versions.yarn add
does not appear to update package.json by default