Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjlampstack
23,932 PointsLots of error messages after npm install
Everything seems to be working and I got the server running, but there were also tonnes of error messages after running npm install. This surely can't be healthy. I'm wondering what the protocol would be for this in a real life situation, and how it would be handled. These messages are overwhelming. Can anyone shed some light?
MY STEPS
- git clone https://hithub.com/treehouse-projects/photoblog.git
- cd photoblog
- npm install
- npm run serve
On npm install I get the following messages
$ npm install
> photoblog@ postinstall C:\xampp\htdocs\angular2-treehouse\photoblog
> npm run build
> photoblog@ build C:\xampp\htdocs\angular2-treehouse\photoblog
> webpack
[at-loader] Using typescript@2.1.4 from typescript and "tsconfig.json" from C:\xampp\htdocs\angular2-treehouse\photoblog\src\tsconfig.json.
[at-loader] Checking started in a separate process...
[at-loader] Ok, 0.569 sec.
Hash: c8cbe786d89bccdb5858
Version: webpack 1.14.0
Time: 59779ms
Asset Size Chunks Chunk Names
app.c8cbe786d89bccdb5858.js 177 bytes 0 [emitted] app
polyfills.c8cbe786d89bccdb5858.js 101 kB 1 [emitted] polyfills
vendor.c8cbe786d89bccdb5858.js 912 kB 2 [emitted] vendor
app.css 1.31 kB 0 [emitted] app
app.c8cbe786d89bccdb5858.js.map 1.03 kB 0 [emitted] app
app.css.map 84 bytes 0 [emitted] app
polyfills.c8cbe786d89bccdb5858.js.map 772 kB 1 [emitted] polyfills
vendor.c8cbe786d89bccdb5858.js.map 6.6 MB 2 [emitted] vendor
index.html 478 bytes [emitted]
+ 662 hidden modules
WARNING in polyfills.c8cbe786d89bccdb5858.js from UglifyJs
Condition always true [../~/angular2-template-loader!./polyfills.ts:6,4]
Dropping unreachable code [../~/angular2-template-loader!./polyfills.ts:10,4]
Condition always true [../~/zone.js/dist/zone.js:9,0]
Non-strict equality against boolean: == false [../~/zone.js/dist/zone.js:1658,0]
Condition left of || always false [../~/zone.js/dist/zone.js:556,0]
Condition left of || always false [../~/zone.js/dist/zone.js:559,0]
Dropping unused variable frameParserStrategy [../~/zone.js/dist/zone.js:674,0]
Dropping unused function findAllExistingRegisteredTasks [../~/zone.js/dist/zone.js:964,0]
Side effects in initialization of unused variable Zone$1 [../~/zone.js/dist/zone.js:23,0]
Side effects in initialization of unused variable zoneAwareAddEventListener [../~/zone.js/dist/zone.js:1100,0]
Side effects in initialization of unused variable zoneAwareRemoveEventListener [../~/zone.js/dist/zone.js:1101,0]
WARNING in vendor.c8cbe786d89bccdb5858.js from UglifyJs
Condition always true [../~/@angular/core/bundles/core.umd.js:7,0]
Dropping unreachable code [../~/@angular/core/bundles/core.umd.js:430,0]
Declarations in unreachable code! [../~/@angular/core/bundles/core.umd.js:430,0]
Dropping unreachable code [../~/@angular/core/bundles/core.umd.js:467,0]
Declarations in unreachable code! [../~/@angular/core/bundles/core.umd.js:467,0]
Condition always true [../~/@angular/common/bundles/common.umd.js:7,0]
Dropping unreachable code [../~/@angular/common/bundles/common.umd.js:2807,0]
Declarations in unreachable code! [../~/@angular/common/bundles/common.umd.js:2807,0]
Side effects in initialization of unused variable WrappedError [../~/@angular/common/bundles/common.umd.js:2408,0]
Condition always true [../~/@angular/platform-browser/bundles/platform-browser.umd.js:7,0]
Condition always true [../~/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js:7,0]
Condition always true [../~/@angular/compiler/bundles/compiler.umd.js:7,0]
Dropping unreachable code [../~/@angular/compiler/bundles/compiler.umd.js:7768,0]
Declarations in unreachable code! [../~/@angular/compiler/bundles/compiler.umd.js:7768,0]
Dropping unreachable code [../~/@angular/compiler/bundles/compiler.umd.js:7820,0]
Declarations in unreachable code! [../~/@angular/compiler/bundles/compiler.umd.js:7820,0]
Dropping unreachable code [../~/@angular/compiler/bundles/compiler.umd.js:7843,0]
Declarations in unreachable code! [../~/@angular/compiler/bundles/compiler.umd.js:7843,0]
Dropping unreachable code [../~/@angular/compiler/bundles/compiler.umd.js:17009,0]
Declarations in unreachable code! [../~/@angular/compiler/bundles/compiler.umd.js:17009,0]
Side effects in initialization of unused variable token [../~/@angular/compiler/bundles/compiler.umd.js:23004,27]
Side effects in initialization of unused variable parentNodeIndex [../~/@angular/compiler/bundles/compiler.umd.js:23902,35]
Non-strict equality against boolean: != true [../~/@angular/compiler/bundles/compiler.umd.js:1096,0]
Dropping unreachable code [../~/@angular/compiler/bundles/compiler.umd.js:8422,0]
Declarations in unreachable code! [../~/@angular/compiler/bundles/compiler.umd.js:8422,0]
Dropping unreachable code [../~/@angular/compiler/bundles/compiler.umd.js:8746,0]
Declarations in unreachable code! [../~/@angular/compiler/bundles/compiler.umd.js:8746,0]
Side effects in initialization of unused variable provider [../~/@angular/compiler/bundles/compiler.umd.js:25393,0]
Side effects in initialization of unused variable ngModuleByPipeOrDirective [../~/@angular/compiler/bundles/compiler.umd.js:27751,0]
Side effects in initialization of unused variable WrappedError [../~/@angular/compiler/bundles/compiler.umd.js:1641,0]
Side effects in initialization of unused variable INT_TYPE [../~/@angular/compiler/bundles/compiler.umd.js:14131,19]
Side effects in initialization of unused variable CATCH_ERROR_VAR [../~/@angular/compiler/bundles/compiler.umd.js:14863,19]
Side effects in initialization of unused variable CATCH_STACK_VAR [../~/@angular/compiler/bundles/compiler.umd.js:14864,19]
Side effects in initialization of unused variable CommentStmt [../~/@angular/compiler/bundles/compiler.umd.js:15118,0]
Side effects in initialization of unused variable NOT_THROW_ON_CHANGES [../~/@angular/compiler/bundles/compiler.umd.js:22800,19]
Child html-webpack-plugin for "index.html":
+ 1 hidden modules
Child extract-text-webpack-plugin:
+ 2 hidden modules
npm WARN photoblog@ No repository field.
npm WARN photoblog@ No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
up to date in 93.001s
5 Answers
james south
Front End Web Development Techdegree Graduate 33,271 Pointsthese are all just warning messages. i'm no expert but i get warnings when i npm install stuff and so do the teachers in the treehouse videos so i ignore them like they do. if it works, it works.
Jacob Mishkin
23,118 PointsDid this happen only when you types npm install? when you run your program are there errors? Lastly, are you using Windows preferred programs not Linux?
jlampstack
23,932 PointsJacob Mishkin This happens only after npm install
. I am using Windows 10.
The program works perfectly, just that i'm seeing these messages.
Jacob Mishkin
23,118 PointsWhat you are seeing are not errors, but rather warnings during the download process.
jlampstack
23,932 PointsThank you Jacob Mishkin . Should I just ignore the errors? Are they irrelevant? Will they cause problems in future if ignored now?
Miguel López
7,055 PointsHi Jay.
It is very unlikely that this warnings will cause problems later.
This are just "comments" about what uglify is doing to your code during minification. As far as i know unreachable code are the statements that are placed in lines that never will be executed, like:
function f() {
var x = 3;
x += 4;
return x; // here the return statement exits the function immediately
x -= 3; // this line is unreachable and never will be executed, so uglify will drop it
}
This is what i understood at least.
Now if you ask me, why unreachable code is there?... well, i don't know.
Luke Pettway
16,593 PointsAs others have mentioned these are normal warnings. It's uglify letting you know that it is finding unreachable code so it is trimming it out. From the looks of it you are using an Angular 2 project, and I have seen those same errors before. It is a bit annoying to have that many warnings displayed, but that just means uglify is doing it's job. Here's a Github issue with someone else seeing the same thing https://github.com/webpack/webpack/issues/2352.
You should only ever see those warnings when you run npm run build
because the Angular webpack build process runs uglify and thus throws warnings that unreachable code was found.
ervw3
17,869 PointsYou spelled GitHub as Hithub, that's why you had an error.
jlampstack
23,932 Pointsjlampstack
23,932 PointsThanks James for taking the time to reply. Good to know. I still have a feeling that this can lead to even more problematic bugs in the future, especially after running updates etc? Wouldn't this leave our program vulnerable to bigger problems down the road?
Again, I'm only a student, so what do i know. Just sharing my thoughts =)