简体   繁体   English

全局安装我的模块不起作用

[英]Installing my module globally not working

This is my package.json:这是我的 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": {
    ...
  }
}

I do npm i -g .我做npm i -g . in my project level and I expect to be able to run testJs globally, but this is what I'm getting?在我的项目级别,我希望能够在全球范围内运行testJs ,但这就是我得到的? Any idea?任何想法?

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