Node.js/npm/版本号码:修订间差异
来自康健生活
| 第138行: | 第138行: | ||
└── @postlab/component-rest@0.0.7 -> ./../../node_modules/.pnpm/@postlab+component-rest@0.0.7_@lezer+common@1.2.1_eslint@8.57.0_graphql@16.9.0_openapi-_4baa08fda89e43a02ac08d9dc46c167c/node_modules/@postlab/component-rest | └── @postlab/component-rest@0.0.7 -> ./../../node_modules/.pnpm/@postlab+component-rest@0.0.7_@lezer+common@1.2.1_eslint@8.57.0_graphql@16.9.0_openapi-_4baa08fda89e43a02ac08d9dc46c167c/node_modules/@postlab/component-rest | ||
</syntaxhighlight>|$|/home/kwy}} | </syntaxhighlight>|$|/home/kwy}} | ||
如下一些语句是参考而来的,都存在一些 匹配问题,但是正则语法万变不离其宗,三步走,第一步捕获字符串,第二步命中字符串,第三步替换。 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
npm ll -p --no-workspaces --depth=0 <pkg> | grep -o "@.*:" | sed 's/.$//; s/^.//' | |||
npm ll -pg --depth=0 <pkg> | grep -o "@.*:" | sed 's/.$//; s/^.//' | |||
npm list --depth=0 --no-workspaces <pkg> | grep <pkg> | cut -d '@' -f2 | |||
npm list --depth=0 --no-workspaces | grep <pkg>| awk '{ print $2; }' | cut -d '@' -f 2</syntaxhighlight>|$|/home/kwy}} | |||