简体   繁体   中英

Installing my module globally not working

This is my 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 . in my project level and I expect to be able to run testJs globally, but this is what I'm getting? 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM