linnovate / mean

The MEAN stack uses Mongo, Express, Angular(6) and Node for simple and scalable fullstack js applications
http://mean.io
12.13k stars 3.45k forks source link

BUILD ERROR following README installation instructions #1929

Open rafamontoya opened 5 years ago

rafamontoya commented 5 years ago

On Windows10 machine, following README installation instructions:

c:\code\mean>npm start

mean@2.0.2 start c:\code\mean concurrently -c "yellow.bold,green.bold" -n "SERVER,BUILD" "nodemon server" "ng build --watch"

[SERVER] [nodemon] 1.18.9 [SERVER] [nodemon] to restart at any time, enter rs [SERVER] [nodemon] watching: . [SERVER] [nodemon] starting node server [SERVER] ../../dist/ [SERVER] (node:8028) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect. [SERVER] server started on port 4040 (development) [SERVER] (node:8028) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. [BUILD] [BUILD] Date: 2018-12-16T10:53:53.908Z [BUILD] Hash: 1b8a55cd0d0ed1e5b8ce [BUILD] Time: 7949ms [BUILD] chunk {main} main.js, main.js.map (main) 603 bytes [initial] [rendered] [BUILD] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 658 bytes [initial] [rendered] [BUILD] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered] [BUILD] chunk {styles} styles.js, styles.js.map (styles) 102 kB [initial] [rendered] [BUILD] [BUILD] ERROR in src/app/shared/shared.module.ts(4,34): error TS2307: Cannot find module '@angular/flex-layout'. [BUILD]

On Chrome browser, localhost:4040, you get:

{"message":"ENOENT: no such file or directory, stat 'c:\code\mean\dist\index.html'"}

Any clues? Thx in advance.

PawelSpoon commented 5 years ago

tried the same yesterday, do have the same issue. but isn't this a duplicate of the media-error issue ?

GuillaumeLevesque commented 5 years ago

same error here, and didnt find any media-error in closed issues. would you have a link?

PawelSpoon commented 5 years ago

https://github.com/linnovate/mean/issues/1925

i have actually both issues. i was able to get rid of the flex issue following an answer in above.thread, but.now i have another runtime.problem.

i thing a working -lock file.would be great

kieuquangloc commented 5 years ago

same error here, please help!

yogesh2022 commented 5 years ago

This issue is because of webpack... Steps I took to fix this problem:

PawelSpoon commented 5 years ago

thats what i basically did yesterday and no help. i will redo the excercise once more from a fresh starting point and report

so: i have started with an freshly cloned mean folder. i have installed webpack and -dev-server globally. i have checked package.json: there are NO devDependencies, there are Dependencies to webpack.. no package-lock,json as fresh folder, same for node_modules.

after npm install i do still have this "webpack": "^4.26.1", "webpack-dev-server": "^3.1.10", only in Dependencies, but not devDependencies.

npm start results in: (the original issue) chunk {main} main.js, main.js.map (main) 641 bytes [initial] [rendered] [BUILD] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 696 bytes [initial] [rendered] [BUILD] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered] [BUILD] chunk {styles} styles.js, styles.js.map (styles) 102 kB [initial] [rendered] [BUILD] [BUILD] ERROR in src/app/shared/shared.module.ts(4,34): error TS2307: Cannot find module '@angular/flex-layout'.

and browser shows: {"message":"ENOENT: no such file or directory, stat 'C:\Users\Lilu\Documents\GitHub\linnovate-mean\mean\dist\index.html'"}

can you please be more precise ? did you ever install flex-layout manually ? did you try to fix the versions ? at what point in time did you do the desribed procedure ?

kieuquangloc commented 5 years ago

This issue is because of webpack... Steps I took to fix this problem:

  • Package.json: remove webpack from DevDependencies
  • rm -R node_modules (remove node_modules folder)
  • npm i -g webpack
  • npm i -g webpack-dev-server
  • remove package-lock.json (if it's there)
  • npm i
  • npm start

I try to follow you, but at the end I still got the message after I run "npm start" and go to: http://localhost:4040/: Error: ENOENT: no such file or directory, stat '/Applications/MAMP/htdocs/mean/dist/index.html'

@yogesh2022 could you send me .zip file of your project?

yogesh2022 commented 5 years ago

Extremely sorry guys, You have to remove the webpack & webpack dev server from dependencies it should not be installed as a local module but a global module. You can also check by running this command " npm ls webpack " if you see multiple instances then you have multiple webpack installed.

yogesh2022 commented 5 years ago

thats what i basically did yesterday and no help. i will redo the excercise once more from a fresh starting point and report

so: i have started with an freshly cloned mean folder. i have installed webpack and -dev-server globally. i have checked package.json: there are NO devDependencies, there are Dependencies to webpack.. no package-lock,json as fresh folder, same for node_modules.

after npm install i do still have this "webpack": "^4.26.1", "webpack-dev-server": "^3.1.10", only in Dependencies, but not devDependencies.

npm start results in: (the original issue) chunk {main} main.js, main.js.map (main) 641 bytes [initial] [rendered] [BUILD] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 696 bytes [initial] [rendered] [BUILD] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered] [BUILD] chunk {styles} styles.js, styles.js.map (styles) 102 kB [initial] [rendered] [BUILD] [BUILD] ERROR in src/app/shared/shared.module.ts(4,34): error TS2307: Cannot find module '@angular/flex-layout'.

and browser shows: {"message":"ENOENT: no such file or directory, stat 'C:\Users\Lilu\Documents\GitHub\linnovate-mean\mean\dist\index.html'"}

can you please be more precise ? did you ever install flex-layout manually ? did you try to fix the versions ? at what point in time did you do the desribed procedure ?

You can simply comment out that code and try re-building the code again... I did the same thing and its working for me.. I will work on the permanent fix and let you know.

Extremely sorry, You have to remove the webpack & webpack dev server from dependencies it should not be installed as a local module but a global module. You can also check by running this command " npm ls webpack " if you see multiple instances then you have multiple webpack installed.

kieuquangloc commented 5 years ago

I'm still stuck in this issue with webpack package, could you send me your fixed folder? please... @yogesh2022

rafamontoya commented 5 years ago

Same here. Followed step by step, but still same error. @yogesh2022 :-(

abarbod commented 5 years ago

Same here. Followed step by step, but still same error. @yogesh2022 :-(

I use win 10

alkthegit commented 5 years ago

Is this still actual? I tried and had no issues related to this one. I just 'npm install'ed and started with 'npm start'. Everything works.

I'm using Windows 10 Build 1809 and WSL (Ubuntu 18.04 LTS)

tsanjoto commented 3 years ago

not sure whether this is still relevant, but I had the same issues on dist folder not found. all I had to do to fix it is to resolve ng serve --open and pretty much I was prompted to update/install the angular cli. after that I had to remove node_modules and npm install again. and then the yarn start resolves