-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: ncu is not a function #1199
Comments
Hi, thanks for reporting. I'm not quite sure what the issue is, as npm-check-updates/src/index.ts Line 349 in 373441e
However, it is also exported as a named function, so you can try npm-check-updates/src/index.ts Lines 161 to 164 in 373441e
Here is a sample Typescript repo that compiles correctly with the documented usage: https://github.com/raineorshine/ncu-test-import-as-module/blob/main/src/index.ts It basically just consists of: import ncu from 'npm-check-updates'
const upgrades = await ncu()
console.log(upgrades) If that doesn't work , try |
Ahh that was the trick, thanks! This is what I needed in the end: import * as ncu from 'npm-check-updates'
const upgrades = await ncu.run()
console.log(upgrades) Thanks for your help! :) |
npm-check-updates
node >= 14
Steps to Reproduce
Steps:
New project using
"npm-check-updates": "16.3.0",
Use recommended config, run
node foo.js
Current Behavior
Following the README, I have set up a basic js file with the config above. When i run that I get
I am used Node
v16.17.0
and npm8.15.0
. Tried adding and removing"type": "module"
from my package.json. Tried in both vanilla js and compiling with tsc.Expected Behavior
Expected to successfully log
The text was updated successfully, but these errors were encountered: