PhpStorm/WebStorm Terminal Shows Old NPM Version
I am on
Windows 10 x64 running
PhpStorm 2018.3. I have updated NodeJS to 10.14.1 which includes NPM 6.4.1.
The problem I have is that the PhpStorm terminal still shows NPM 3.10.10 although it shows the correct Node version.
I have tried:
- Restarting PhpStorm
- Restarting the computer
- Uninstalling and re-installing Node, then restarting the computer
This causes trouble because the version of NPM running in my IDE terminal cannot see the globally installed packages.
Global packages from Windows command line
Global packages from PhpStorm terminal
How do I get to the bottom of this?
where npm from the PhpStorm terminal shows that a local dependency has installed the older NPM version
Is it expected for a locally installed NPM to make it impossible for the terminal to see my global packages?
When I run the Windows command line tool from within the project folder, everything works as expected, unlike the PhpStorm terminal. The right version is seen, global packages are seen, and the
where command cannot see the local NPM installed in node_modules
Thanks to Lena for the solution. Turns out that with
PhpStorm 2018.3, a new enabled-by-default setting adds the binaries in the project's local
$PATH, so the terminal would see the locally installed NPM version instead of the global one. To resolve the issue I went to
Settings > Tools > Terminal and unchecked this option:
Add node_modules/.bin from the project root to %PATH%
If anyone involved is reading this, I would suggest allowing the user to add a blacklist of binaries that should not be added when this option is checked.
The problem is caused by Add 'node_modules/.bin' from the project root to $PATH (Settings | Tools | Terminal) - as you have
npm binary in
node_modules/.bin, it's also added to
%PATH% and thus used when running
npm in terminal. Disabling this option should solve the issue
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error