简体   繁体   English

如何使用 npm init<initializer> 我的包裹? 命令未找到错误

[英]how to use npm init <initializer> for my package? command not found error

I have a package named: create-ts-starter in npm registry https://www.npmjs.com/package/create-ts-starter .我在 npm 注册表https://www.npmjs.com/package/create-ts-starter 中有一个名为 create-ts-starter 的包。

I want to use it as my project starter with command npm init ts-starter as it explained in https://docs.npmjs.com/cli/init我想使用它作为我的项目启动器,命令npm init ts-starter正如它在https://docs.npmjs.com/cli/init 中解释的那样

but when I run it, it just show me error:但是当我运行它时,它只显示错误:

npm init ts-starter
npx: installed 1 in 1.65s
command not found: create-ts-starter

this is the Github repo https://github.com/saostad/node-typescript-starter这是 Github 存储库https://github.com/saostad/node-typescript-starter

what am I missing?我错过了什么?

I found out what I was missing!我发现我错过了什么! it needs a "bin" field in package.json file and a script to run the rest of the process.它需要 package.json 文件中的“bin”字段和运行其余过程的脚本。 now if you run npm init ts-starter it does all things I wanted :)现在,如果你运行npm init ts-starter它会做我想要的所有事情:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM