[英]Can my NPM CLI package be executed on CMD without installing globally?
[英]Installing my module globally not working
这是我的 package.json:
{
"name": "testJs",
"type": "module",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": {
"testJs": "index.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
...
}
}
我做npm i -g .
在我的项目级别,我希望能够在全球范围内运行testJs
,但这就是我得到的? 任何想法?
C:\Users\myComputer\testJs>npm i -g .
added 1 package, and audited 2 packages in 1s
found 0 vulnerabilities
C:\Users\myComputer\testJs>testJs
'testJs' is not recognized as an internal or external command,
operable program or batch file.
正如@tushar-shahi所说,您尝试在npm i -g .
之后运行testJs
而不是jsTest
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.