[BUG] npm init not working - throws error
Closed this issue · 4 comments
javedbartlett commented
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When running npm init, i receive a generic error. I've tried different folders, but it makes no difference. It seems to work fine with yarn. I've tried running different versions of Node and Npm. I've tried with or without NVM, but the same error occurs on Sonoma.
Expected Behavior
I expect no error, and to be walked through the npm init tutorial.
Steps To Reproduce
- open terminal and change directory to a new project folder
- run
npm init
ornpm init -y
- ---> see error
Environment
- npm: 10.2.4
- Node: 20.11.1
- OS: Mac OS Sonoma 14.2.1
- platform: Macbook Pro
javedbartlett commented
Attached is the error log file.
javedbartlett commented
wraithgar commented
I can't reproduce this. The log seems to indicate that you are typing npm run init
not npm init
. The error missing script: init
also indicates this.
This is not an npm bug, it appears you have some sort of os alias or config that is doing this.
javedbartlett commented
@wraithgar you're correct. It seems like an old script snuck into my .zshrc
: alias npm='npm run '
Thank you!