question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run tsoa when installed globally

See original GitHub issue
npm install -g tsoa
tsoa --help
module.js:442
    throw err;
    ^

Error: Cannot find module 'C:\Users\dave\AppData\Roaming\npm/package.json'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at getPackageJsonValue (C:\Users\dave\AppData\Roaming\npm\node_modules\tsoa\dist\cli.js:107:25)
    at Object.<anonymous> (C:\Users\dave\AppData\Roaming\npm\node_modules\tsoa\dist\cli.js:33:18)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3

Doesn’t work.

vs

npm install tsoa
node ./node_modules/tsoa/dist/cli.js --help
Usage: node_modules\tsoa\dist\cli.js <command> [options]

Commands:
  swagger  Generate swagger spec
  routes   Generate routes

Options:
  --help, -h  Show help                                                [boolean]

Works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danzelcommented, Jul 24, 2016

Thanks! Maybe it could check the PWD that the command was ran from? Then it could still find the local package.json.

0reactions
lukeautrycommented, Jul 25, 2016

I think that’s a pretty good idea, I’ll most likely implement that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tsoa - npm
Start using tsoa in your project by running `npm i tsoa`. There are 129 other projects in the npm registry using tsoa.
Read more >
'tsc command not found' in compiling typescript - Stack Overflow
Globally installing TypeScript package worked for me. npm install typescript -g.
Read more >
Getting started | tsoa - GitHub Pages
Configuring tsoa and typescript; Defining our first model; Defining a simple controller; Creating our express server; Building the routes file; What's next?
Read more >
David Aktary – TypeScript and Tsoa as a Source of Truth
Tsoa is a simple command-line tool you can insert in your compile-time workflow. ... Your browser can't play this video.
Read more >
How to Install a Node.js Application
js, cPanel Technical Support can't help you with these steps. We recommend that only experienced system administrators perform these steps. We ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found