Closed Mankore closed 2 months ago
The command npm list --json
should return valid json. You could reply with the result of this command so I could understand if it is just npm returning malformed json or if there is another problem (like inability to find npm).
I have the same errors..
`
npm list --json [error] SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2) npm outdated --json [error] TypeError: items is not iterable `
@dtarnawsky The result of that command =
[error] SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
@dtarnawsky npm list --json
returns valid json in regular terminal, but in ionic output window it shows those errors
To reproduce the error I would need a copy of your project. Are you able to share your code to damian@ionic.io?
This error is not project-dependent, it also happens for me in cloned ionic-react-conference-app for example.
The extension is either not finding npm
or is finding a version of npm
that is very outdated. This can be caused by a non standard shell and you can specify the shell you use in Advanced
> Settings
> Shell Path
. You could also have problems if you are using a misconfigured node manager like nvm
or volta
. I've also seen problems where VS Code is so old it cannot install the latest version of the extension so uses a really old version.
So to get started, what node version are you using? and version of npm? and any node manager used? Are you using Windows, Linux or Mac?
Mac (2019) node v20.16.0 npm 10.8.1 nvm 0.40.1 VS Code latest
I'm using zsh on system level as a default terminal, and bash in vscode. This might be the problem i guess, will try to play around it
P.S. setting default terminal to zsh for vscode and ionic extension didn't help.
Hi @Mankore , there was a small change to how .nvm is handled in v1.93 of the extension. I was wondering if this resolved your issue?
Hi @dtarnawsky, yes the errors are gone now, thanks :) Closing the issue
On startup in ionic output window i see following errors:
have several projects, one of which is in NX monorepo, same error everywhere. Other extensions work fine with npm and node. Do you have any ideas what could be the issue? Thanks!