when running via npx it uses the wrong path
See original GitHub issuenpx tsup ./src/index.ts --format esm,cjs,iife --dts --minify
Even after installing typescript
it wouldn’t solve the issue, adding tsup to the current project and then trying with the local version fixed the issue.
Error: Cannot find module 'typescript'
Require stack:
- /Users/xo/.npm/_npx/96410/lib/node_modules/tsup/node_modules/rollup-plugin-dts/dist/rollup-plugin-dts.js
- /Users/xo/.npm/_npx/96410/lib/node_modules/tsup/dist/rollup.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/xo/.npm/_npx/96410/lib/node_modules/tsup/node_modules/rollup-plugin-dts/dist/rollup-plugin-dts.js:6:10)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
Emitted 'error' event on process instance at:
at emitUnhandledRejectionOrErr (internal/event_target.js:543:11)
at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:358:9)
at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/xo/.npm/_npx/96410/lib/node_modules/tsup/node_modules/rollup-plugin-dts/dist/rollup-plugin-dts.js',
'/Users/xo/.npm/_npx/96410/lib/node_modules/tsup/dist/rollup.js'
]
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
when running via npx it uses the wrong path - Bountysource
Even after installing typescript it wouldn't solve the issue, adding tsup to the current project and then trying with the local version fixed ......
Read more >npx not found, thought it is in the PATH - Stack Overflow
I'm setting up a local environment for the React Tutorial and I'm having some issues. What version of node do I have? $...
Read more >Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >NPX Create React APP Not Working - YouTube
But sometimes it throws error / exception. I can't install react using npx create-react-app and npx create react app not working for me....
Read more >http-server - npm
Running on-demand: Using npx you can run the script without installing it first: npx http-server [path] [options] · Globally via npm. npm install ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So basically, you have to install tsup locally in order to use
--dts
flag. If not please provide a repo so I can take a look.Can confirm the issue with npx, install
tsup
locally will solve the issue. Flag--no-save
can be used (npm i tsup --no-save
on CI/CD) to avoid modifyingpackage.json