Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Commented Issue: Crash when opening a project with invalid package.json [563]

$
0
0
When opening an existing NodeJs Visual Studio project with an invalid package.json, project loads failed and it crashes VS. It would be nice to popup an alert showing for example: "Invalid package.json file, load failed". It took me sometime to find out there was a problem in the package.json.

Thanks,
Jeremy
Comments: I can reproduce it like this (on branch rgnpm01): 1. Create a new blank Node.js console app in VS. 2. Open up package.json. 3. Paste in the following: ``` { "name": "angular-app-server", "description": "Back end server to support our angular app", "version": "0.0.1", "private": true, "dependencies": { "express": "~3.0", "passport": "~0.1.12", "express-namespace": "~0.1.1", "open": "0.0.3", "request": "~2.16.6" }, "devDependencies": { "rewire": "~1.0.3", "supervisor": "~0.4.1", "grunt": "~0.4", "grunt-contrib-jshint": "~0.2.0", "grunt-contrib-nodeunit": "~0.1.2" } } ``` 4. Save the edited package.json. 5. Right-click on the npm node in Solution Explorer. 6. Click Install Missing npm Modules. The npm node will populate with modules as they're installed but, even after npm has completed executing (see the Output window) the CPU usage is still high as the hierarchy updates itself to include all the files that have been installed in the node_modules directory.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>