![](/img/trans.png)
[英]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.