Reputation: 543
Okay so I'm picking up an angular 6 project at work and I'm having some trouble getting it to build properly.
I run npm install, and it installs the node modules.
I npm start and it won't start, saying that the webpack build failed. Here's the error:
david@ReNoir:/mnt/c/Users/Owner/TCWork/Spanner/spanner-app/dev-web/SpannerWeb$ npm start
> [email protected] start /mnt/c/Users/Owner/TCWork/Spanner/spanner-app/dev-web/SpannerWeb
> ng serve dev -open
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
10% building modules 4/4 modules 0 activewebpack: wait until bundle finished: / Date: 2018-06-21T11:57:42.327ZHash: 19c35131157ef6b74b06
Time: 13491ms
chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 3.17 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 577 bytes [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 42.4 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 853 kB [initial] [rendered]
ERROR in Cannot read property 'length' of undefined
ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/@angular/cli/node_modules/sass-loader/lib/loader.js??ref--8-3!./src/styles.scss
Module build failed:
@import "@shared-module/scss/core";
^
File to import not found or unreadable: @shared-module/scss/core.
in /mnt/c/Users/Owner/TCWork/Spanner/spanner-app/dev-web/SpannerWeb/src/styles.scss (line 1, column 1)
webpack: Failed to compile.
I'm new to code. I'm more of a designer learning to code. But I'm having trouble understanding why this won't build. I've only taken a little bit of webpack tutorials but as far as I understand, you need to have a webpack.config.js file in your root folder. But I can't find any webpack.config.js file anywhere even after npm install and searching it etc. I found a couple of the node deps have webpack.config.js files but other than that, it's barren.
Any clue on what I'm supposed to do?
Looking at the error message I have an inkling that maye it's due to the original dev having some of their deps like sass loader etc installed globally on their machine, so they aren't included in the deps folder and that's what is causing the issue?
Upvotes: 1
Views: 802
Reputation: 6974
Apparently a SCSS file tries to import another SCSS file from a module "@shared-module" which may not be installed or added as a dependency in this project.
Installing this module as a project dependency could help. However it looks like a private module so you may need to install it from a local folder (another repository maybe?) like this:
npm install <folder>
Concerning the "missing" webpack config it's normal since Angular CLI is completely hiding it from you. The only way to actually see the webpack config is to eject the project from Angular CLI with the command ng eject
. But like this you won't be able to use Angular CLI anymore.
Upvotes: 1