admin管理员组文章数量:1207126
I'm trying to understand how this Node.js command works:
npx @11ty/eleventy
From what I understood, it looks like npx
first goes into node_modules/@11ty/eleventy
and finds the package.json file. More specifically, it looks for this part:
"bin": {
"eleventy": "cmd.cjs"
}
Now, I tried changing the key from "eleventy" to "hey" and now when running npx @11ty/eleventy
I got this error:
sh: hey: command not found
"sh" probably indicates this comes from the shell, which probably means that "npx" tried to find this executable inside node_modules/.bin
, but couldn't find it.
How did "npx" decide to execute hey
in the first place? I don't quite understand how the matching algorithm works when it comes to npx
and scoped packages. Tried looking it up everywhere but couldn't find any documentation on this.
本文标签: nodejsnpx and scoped packagesStack Overflow
版权声明:本文标题:node.js - npx and scoped packages - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738679838a2106484.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论