Project: appceleratorstudio
Issue TISTUD-2538: NPM: npm install not validated on studio startup
When studio first starts, the npm is not prompted to install if it is not installed, this will prevent Alloy, CLI, and ACS from installing. Note this is not a typical use case and npm is assumed to be installed along with node.js. This is an improvement that would make studio a bit more robust. Studio Error Log: {code} !ENTRY com.appcelerator.titanium.update 4 0 2012-10-16 14:10:27.465 !MESSAGE (Build 3.0.0.201210151149) [ERROR] NPM is not installed. !STACK 1 org.eclipse.core.runtime.CoreException: NPM is not installed. com.appcelerator.titanium.nodejs.internal.core.NodePackageManager.getInstalledVersion(NodePackageManager.java:259) com.appcelerator.titanium.update.TitaniumSDKUpdater.getPackageLatestVersion(TitaniumSDKUpdater.java:619) com.appcelerator.titanium.update.TitaniumSDKUpdater.getCLIUpdates(TitaniumSDKUpdater.java:637) com.appcelerator.titanium.update.TitaniumSDKUpdater.hasCLIUpdates(TitaniumSDKUpdater.java:227) com.appcelerator.titanium.update.TitaniumSDKUpdater.hasUpdates(TitaniumSDKUpdater.java:164) com.appcelerator.titanium.update.handler.TitaniumUpdateHandler.execute(TitaniumUpdateHandler.java:34) org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829) org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815) org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) org.eclipse.equinox.launcher.Main.run(Main.java:1410) !SUBENTRY 1 com.appcelerator.titanium.nodejs.core 4 0 2012-10-16 14:10:27.466 !MESSAGE NPM is not installed. !ENTRY com.appcelerator.titanium.update 4 0 2012-10-16 14:10:27.468 !MESSAGE (Build 3.0.0.201210151149) [ERROR] NPM is not installed. !STACK 1 org.eclipse.core.runtime.CoreException: NPM is not installed. com.appcelerator.titanium.nodejs.internal.core.NodePackageManager.getInstalledVersion(NodePackageManager.java:259) com.appcelerator.titanium.update.TitaniumSDKUpdater.getPackageLatestVersion(TitaniumSDKUpdater.java:619) com.appcelerator.titanium.update.TitaniumSDKUpdater.getAlloyUpdates(TitaniumSDKUpdater.java:662) com.appcelerator.titanium.update.TitaniumSDKUpdater.hasAlloyUpdates(TitaniumSDKUpdater.java:253) com.appcelerator.titanium.update.TitaniumSDKUpdater.hasUpdates(TitaniumSDKUpdater.java:164) com.appcelerator.titanium.update.handler.TitaniumUpdateHandler.execute(TitaniumUpdateHandler.java:34) org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829) org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815) org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) org.eclipse.equinox.launcher.Main.run(Main.java:1410) !SUBENTRY 1 com.appcelerator.titanium.nodejs.core 4 0 2012-10-16 14:10:27.469 !MESSAGE NPM is not installed. !ENTRY com.appcelerator.titanium.update 4 0 2012-10-16 14:10:27.470 !MESSAGE (Build 3.0.0.201210151149) [ERROR] NPM is not installed. !STACK 1 org.eclipse.core.runtime.CoreException: NPM is not installed. com.appcelerator.titanium.nodejs.internal.core.NodePackageManager.getInstalledVersion(NodePackageManager.java:259) com.appcelerator.titanium.update.TitaniumSDKUpdater.getPackageLatestVersion(TitaniumSDKUpdater.java:619) com.appcelerator.titanium.update.TitaniumSDKUpdater.getACSUpdates(TitaniumSDKUpdater.java:650) com.appcelerator.titanium.update.TitaniumSDKUpdater.hasACSUpdates(TitaniumSDKUpdater.java:240) com.appcelerator.titanium.update.TitaniumSDKUpdater.hasUpdates(TitaniumSDKUpdater.java:164) com.appcelerator.titanium.update.handler.TitaniumUpdateHandler.execute(TitaniumUpdateHandler.java:34) org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829) org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815) org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) org.eclipse.equinox.launcher.Main.run(Main.java:1410) !SUBENTRY 1 com.appcelerator.titanium.nodejs.core 4 0 2012-10-16 14:10:27.471 !MESSAGE NPM is not installed. {code} Steps to Reproduce: 1. Uninstall npm (i.e. delete npm folder from node_modules). 2. Start studio. Actual Result: No prompt to install npm. No prompts to install alloy, acs, or titanium, and no future updates for those node modules. Expected Result: Prompt to install npm if it is not installed.
Story points: 5