Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 397633

Summary: Add NPM support on shell page.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: NodeAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mamacdon
Version: 1.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 395173    
Bug Blocks:    

Description libing wang CLA 2013-01-07 17:26:03 EST
We need to add npm support on shell page.
Comment 1 libing wang CLA 2013-01-08 15:04:38 EST
We will spawn a node child process calling npm-cli.js., followed by what ever the npm args.
By doing this, we are consistent with all the other node commands we already implemented: start a process, render all stdout to the shellp page, then process stops after npm has done the job.

Hacked on getting the cwd from a file passed by shell page and spawned the "node npm-cli.js". 

Tried this prototype on npm install, uninstall, list, etc, kind of working..
Eventually we will:
1.when start node server, add an optional server.config file. This will allow user to define the path of npm if it is installed seperately VS node.
2.Fix bug 395173 to get the cwd.
3.If there is no server.config defining the npm path, we have to use a relative path under where node is install.
4.If nether 1 nor 3 can find npm, then we will prompt user in the shell page: "Please add npm path to the server.config and restart server".