在VS2017 15.7.1中默认未还原Npm

时间:2018-10-10 12:22:20

标签: node.js npm visual-studio-2017

我正在为控件创建ASP.NET Core项目模板。创建自定义项目模板后,我正在使用一些第三方Npm软件包来使用我的控件。我已经添加了NPM安装本身的逻辑,以克服从项目模板创建自定义项目时从项目恢复NPM的手动过程。

                    System.Diagnostics.Process p = new System.Diagnostics.Process();
                    p.StartInfo.FileName = "cmd.exe";
                    string npmArguments = "/c npm install " + "@syncfusion/ej2-js-es5"+ "@" + "16.3.21";
                    p.StartInfo.Arguments = npmArguments;
                    p.StartInfo.RedirectStandardError = false;
                    p.StartInfo.RedirectStandardOutput = false;
                    p.StartInfo.UseShellExecute = true;
                    p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    Environment.CurrentDirectory = NPMInstallerPath;
                    try
                    {
                        dte.StatusBar.Text = ("JS: " + project.Name + ", Adding Syncfusion EJ2 NPM to the project...");
                        p.Start();
                        p.WaitForExit();
                    }

enter image description here

但是创建项目后,默认情况下不会还原NPM。 package.json文件中提供了NPM软件包条目。仅在VS2017 15.7.1中复制了此问题。我在VS2017 15.8.4中检查了相同的VSIX,未重现此问题。 NPM已正确安装。

您能建议我解决此问题吗?

0 个答案:

没有答案