Docs: Use npm pkg set instead of deprecated npm set-script (#13186)
This commit is contained in:
1 parent
955553bb39
commit
765cae2552
1 file changed
+2
-4
+2
-4
@@ -103,7 +103,7 @@ For example, you can do the following to have Prettier run before each commit:
|
||||
```bash
|
||||
npm install --save-dev husky lint-staged
|
||||
npx husky install
|
||||
npm set-script prepare "husky install"
|
||||
npm pkg set scripts.prepare="husky install"
|
||||
npx husky add .husky/pre-commit "npx lint-staged"
|
||||
```
|
||||
|
||||
@@ -112,7 +112,7 @@ For example, you can do the following to have Prettier run before each commit:
|
||||
```bash
|
||||
yarn add --dev husky lint-staged
|
||||
npx husky install
|
||||
npm set-script prepare "husky install"
|
||||
npm pkg set scripts.prepare="husky install"
|
||||
npx husky add .husky/pre-commit "npx lint-staged"
|
||||
```
|
||||
|
||||
@@ -120,8 +120,6 @@ For example, you can do the following to have Prettier run before each commit:
|
||||
|
||||
<!--END_DOCUSAURUS_CODE_TABS-->
|
||||
|
||||
> Note: npm **set-script** command requires at least **npm v7.x**. See https://docs.npmjs.com/cli/v7/commands/npm-set-script.
|
||||
|
||||
2. Add the following to your `package.json`:
|
||||
|
||||
```json
|
||||
|
||||
Reference in new issue
Block a user