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

Created Issue: Sometimes status bar reports that npm ran successfully when errors were reported [579]

$
0
0
Specifically it seems this can occur when no output is written to the error stream, but a non-zero exit code is returned.

I have however also seen it where output is written to the error stream but no exception is thrown.

For example, to reproduce:

1. Create a new blank Node.js Console Application.
2. Open package.json, and replace its content with 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",
/*"passport-local": "~0.1.6",*/
"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"
}
}
```

3. Save package.json
4. The npm node in Solution Explorer should populate with missing modules.
5. Right-click the npm node and click Install Missing npm Modules.
6. Output similar to the following will be written to the Output window.


====Executing command 'npm install '====

npm ERR! install Couldn't read dependencies
npm ERR! Failed to parse json
npm ERR! Unexpected token /
npm ERR! File: C:\GitWork\testing\NodejsConsoleApp10\NodejsConsoleApp10\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"

====npm command completed with exit code 1====

npm ERR! cwd C:\GitWork\testing\NodejsConsoleApp10\NodejsConsoleApp10


7. Despite this, the status bar will report that npm ran successfully.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



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