[英]Using yargs (npm package), how to give an error if command not found?
[英]how to use npm init <initializer> for my package? command not found error
我在 npm 注冊表https://www.npmjs.com/package/create-ts-starter 中有一個名為 create-ts-starter 的包。
我想使用它作為我的項目啟動器,命令npm init ts-starter
正如它在https://docs.npmjs.com/cli/init 中解釋的那樣
但是當我運行它時,它只顯示錯誤:
npm init ts-starter
npx: installed 1 in 1.65s
command not found: create-ts-starter
這是 Github 存儲庫https://github.com/saostad/node-typescript-starter
我錯過了什么?
我發現我錯過了什么! 它需要 package.json 文件中的“bin”字段和運行其余過程的腳本。 現在,如果你運行npm init ts-starter
它會做我想要的所有事情:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.