npm没有给脚本提供建议。

时间:2022-01-06 23:40:37

I had to setup my dev machine from scratch due to some issues and in doing so, I also upgraded from Ubuntu 14.04 to 16.04.

由于一些问题,我不得不从头开始安装我的开发机器,在此过程中,我还从Ubuntu 14.04升级到16.04。

I installed the latest node and npm, but I observe a strange behavior. When I press tab after typing the command

我安装了最新的节点和npm,但是我观察到一个奇怪的行为。输入命令后按tab键

 npm run sta

I am not getting any suggestions/autocomplete on the terminal. In the example above, I would expect it to autocomplete to

我在终端机上没有得到任何建议/自动完成。在上面的例子中,我希望它自动完成。

npm run start

I have defined many scripts within the package.json, but none of those show up as suggestions or autocomplete, on pressing tab. E.g. within my scripts I have defined, pack-linux-x64, pack-darwin-x64 etc. but on typing

我在包中定义了许多脚本。json,但在按tab时,没有一个显示为建议或自动完成。例如,在我的脚本中,我定义了pack-linux-x64、pack-darwin-x64等等,但都是输入

npm run pack

and pressing tab, I am not getting the suggestions from what I have defined within the scripts of my package.json. Strangely, I get

按tab键,我不会从packag .json脚本中定义的内容中得到建议。奇怪的是,我得到了

npm run package.json 

as the suggestion when I press tab.

我按tab时的建议。

This, of course, was not the behavior in my previous system.

当然,这并不是我之前系统中的行为。

If I type the command myself,e.g. npm run pack-linux-x64 then it runs without any issues.

如果我自己输入命令,例如。npm运行package -linux-x64,然后运行时没有任何问题。

How can I fix this?

我该怎么解决这个问题呢?

1 个解决方案

#1


2  

Solution: npm-completion - Tab Completion for npm

解决方案:npm完成- npm标签完成

#1


2  

Solution: npm-completion - Tab Completion for npm

解决方案:npm完成- npm标签完成