npm是使用nvm安装的,但是IntelliJ不知道 [英] npm is installed using nvm but IntelliJ does not know about it
问题描述
我使用NVM安装了NPM.
I installed NPM using NVM.
当我在Intellij终端中使用npm时,它说我没有安装NPM.但是,如果我使用Ubuntu终端,它将可以正常工作.
When I use npm in Intellij terminal, it says I don't have NPM installed. But if I use Ubuntu terminal, it is working.
这是我尝试过的:
我已经尝试设置节点解释器(在语言和框架">节点和NPM"中,设置为〜/.nvm/versions/node/v6.8.0/bin/node
).
I have already tried to set my node interpreter (in "Language and Framework" > "Node and NPM", set to ~/.nvm/versions/node/v6.8.0/bin/node
).
我还已经启用了Node.js Core库.那里显示了包含的npm软件包.
I have also already enabled the Node.js Core library. There it shows the npm package is included.
但是IntelliJ终端仍然抱怨我没有安装npm.为什么?
But the IntelliJ terminal still complains I haven't installed npm. Why?
推荐答案
这是因为Idea终端默认情况下会启动登录Shell,因此不会读取.bashrc文件.
It is because idea terminal launches a login shell by default, so the .bashrc file is not read.
要解决此问题:
在IntelliJ中打开设置".然后,在左侧面板中展开工具",然后单击终端".
Open "Settings" in IntelliJ. Then, expand "Tools" in the left panel, then click 'Terminal'.
将-i添加到Shell路径.(例如/bin/bash -i)
Add -i to the Shell Path. (eg. /bin/bash -i)
这篇关于npm是使用nvm安装的,但是IntelliJ不知道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!