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

assets folder doesn't exist #24

Open
invegat opened this issue Nov 11, 2016 · 5 comments
Open

assets folder doesn't exist #24

invegat opened this issue Nov 11, 2016 · 5 comments

Comments

@invegat
Copy link

invegat commented Nov 11, 2016

ng server made this error
"ENOENT: no such file or directory, stat 'C:\Angular2\material2-app\src\assets'"
my actions:
git clone -b master --single-branch https://github.com/jelbourn/material2-app.git
cd material2-app
npm install
npm start


The directory 'C:\Angular2\material2-app\src\assets'" doesn't exist.

@realtebo
Copy link

I'm using latest node LTS (6.9.1) and npm is at v3.10.9 on Windows 7 Pro 64 bit.
Same problem.

Error: ENOENT: no such file or directory, stat 'C:\Users\realtebo\Downloads\material2-app\src\assets'
    at Error (native)
    at Object.fs.statSync (fs.js:987:18)
    at C:\Users\realtebo\Downloads\material2-app\node_modules\angular-cli\plugins\glob-copy-webpack-plugin.js:16:64
    at Array.map (native)
    at GlobCopyWebpackPlugin.apply (C:\Users\realtebo\Downloads\material2-app\node_modules\angular-cli\plugins\glob-copy-webpack-plugin.js:16:29)
    at Compiler.apply (C:\Users\realtebo\Downloads\material2-app\node_modules\tapable\lib\Tapable.js:233:16)
    at WebpackOptionsApply.process (C:\Users\realtebo\Downloads\material2-app\node_modules\webpack\lib\WebpackOptionsApply.js:59:18)
    at webpack (C:\Users\realtebo\Downloads\material2-app\node_modules\webpack\lib\webpack.js:28:48)
    at Class.run (C:\Users\realtebo\Downloads\material2-app\node_modules\angular-cli\tasks\serve-webpack.js:25:27)
    at C:\Users\realtebo\Downloads\material2-app\node_modules\angular-cli\commands\serve.js:93:26
    at process._tickCallback (internal/process/next_tick.js:103:7)

I noticed these warn at the end of build process:

npm WARN @ngtools/[email protected] requires a peer of @angular/[email protected] but none was installed.
npm WARN @ngtools/[email protected] requires a peer of @angular/[email protected] but none was installed.

@realtebo
Copy link

realtebo commented Nov 24, 2016

cd src
mkdir assets
cd ..
ng server

But it's still NOT working

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './aot/app/app.module.ngfactory' in 'C:\Users\realtebo\Downloads\material2-app\src'
 @ ./src/main.ts 8:0-76
 @ multi main
Child html-webpack-plugin for "index.html":
         Asset    Size  Chunks       Chunk Names
    index.html  3.4 kB       0
webpack: bundle is now VALID.
[default] Checking started in a separate process...
[default] C:\Users\realtebo\Downloads\material2-app\src\main.ts:25:42
    Cannot find module './aot/app/app.module.ngfactory'.
[default] Checking finished with 1 errors

@barakakoun
Copy link

Try this:

  1. Make the 'assets' folder manually
  2. Run ./node_modules/.bin/ngc -p ./src/ (as written in the main.ts file)
    Then run again.
    Worked for me :)

@realtebo
Copy link

realtebo commented Nov 28, 2016

I restart from scratch.
Note that I'm workingw with node 6.9.1,npm, 3.10.9, Windows 7 Pro 64bit, on a subdir of <my_user> folder, so I surely have read/write permissions. Also, each of following commands is executed from a command prompt without admin rights.

Completely clear npm cache

rmdir <my_user>\AppData\Roaming\npm-cache /Q /S

Remove entire folder project

rmdir <my_user>\material2-app /Q /S

Re-cloned and re-installed npm modules

cd <my_user>\Downloads
git clone https://github.com/jelbourn/material2-app.git
cd material2-app
npm install

Trying @barakakoun 's method

cd src
mkdir assets
cd ..
.\node_modules\.bin\ngc -p .\src\
ng server

Esit

App working

Question 1: why is it needed AoT compiling?
Question 2: what does ngc -p do ?

Suggestion: please add to main read.me a short paragraph about the need of Aot compiling. I think other newbies, like me, never will open the main.ts before try to run it.

@hswolf
Copy link

hswolf commented Jan 16, 2017

Hi @realtebo,
For your questions:

  1. It is related to performance, you can find more here https://angular.io/docs/ts/latest/cookbook/aot-compiler.html
  2. I have no idea :), but if you take a look at src/main.ts there is a comment say that you need to run that comment before boostraping the app.

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

4 participants