簡體   English   中英

全局安裝我的模塊不起作用

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM