Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD ERROR following README installation instructions #1929

Open
rafamontoya opened this issue Dec 16, 2018 · 15 comments
Open

BUILD ERROR following README installation instructions #1929

rafamontoya opened this issue Dec 16, 2018 · 15 comments

Comments

@rafamontoya
Copy link

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.

@rafamontoya rafamontoya changed the title BUILD ERROR BUILD ERROR following README installation instructions Dec 16, 2018
@PawelSpoon
Copy link

PawelSpoon commented Dec 16, 2018

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

@GuillaumeLevesque
Copy link

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

@PawelSpoon
Copy link

#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
Copy link

same error here, please help!

@yogesh2022
Copy link

yogesh2022 commented Dec 18, 2018

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

  • Package.json: remove webpack from Dependencies
  • 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

@PawelSpoon
Copy link

PawelSpoon commented Dec 18, 2018

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
Copy link

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
Copy link

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
Copy link

yogesh2022 commented Dec 19, 2018

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
Copy link

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

@rafamontoya
Copy link
Author

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

@abarbod
Copy link

abarbod commented Jan 12, 2019

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

I use win 10

@alkthegit
Copy link

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
Copy link

tsanjoto commented Feb 10, 2021

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

@chhex
Copy link

chhex commented Sep 15, 2024

6 years later, still the same problem .... looking to learn MEAN Stack , not really a great experience for a repo which has that many stars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants