angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Builds not working (WebPack)

Open masaanli opened this issue 10 years ago • 7 comments

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10
  2. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here: v6.2.2
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

When I build and run the index.html in Chrome I get this errors in my console...

Failed to load resource: net::ERR_FILE_NOT_FOUND file:///C:/polyfills.7451a0bbf21094e753c9.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND file:///C:/main.9ae37fed9dc29b2f0ff3.bundle.js Failed to load resource: net::ERR_FILE_NOT_FOUND file:///C:/favicon.ico Failed to load resource: net::ERR_FILE_NOT_FOUND

  1. The log given by the failure. Normally this include a stack trace and some more information.
  2. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

masaanli avatar Aug 06 '16 09:08 masaanli

Same issue for me. I ran ng build prod and got success message but I still see over 2000 files in build/vendor folder. I was expecting single js file or maximum 2, one for vendors and one for app.

I'm using Mac with OSX 10.11.6

ng --version 
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.10
node: 4.4.4
os: darwin x64

achintverma avatar Aug 07 '16 15:08 achintverma

@achintverma at my side it generate only 4 files as I remmeber in a dist folder. That's it.

masaanli avatar Aug 07 '16 18:08 masaanli

@masaanli Can you please paste the output of ng --version It may be like @achintverma where you are still referencing the beta.10 version of angular-cli and not beta.11-webpack Could you please ensure that your projects package.json references the beta.11-webpack version of angular cli? If not you can run:

npm install --save-dev angular-cli@webpack

Hopefully this helps

FraserKillip avatar Aug 07 '16 23:08 FraserKillip

@FraserKillip First I tried the command u said (npm install --save-dev angular-cli@webpack) but got this error..

Not compatible package with my opering System, having Windows 10.

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:                                                                                                                            
npm WARN notsup Not compatible with your operating system or architecture: [email protected]                                                                                                           
npm ERR! Windows_NT 10.0.14393                                                                                                                                                                       
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "angular-cli@webpack"                                     
npm ERR! node v6.2.2                                                                                                                                                                                 
npm ERR! npm  v3.9.5                                                                                                                                                                                 
npm ERR! path c:\repos\test\test-web\node_modules\.staging\abbrev-a166e773                                                                                                                 
npm ERR! code ENOENT                                                                                                                                                                                 
npm ERR! errno -4058                                                                                                                                                                                 
npm ERR! syscall rename                                                                                                                                                                              

npm ERR! enoent ENOENT: no such file or directory, rename 'c:\repos\test\test-web\node_modules\.staging\abbrev-a166e773' -> 'c:\repos\test\test-web\node_modules\ember-cli\node_m
odules\npm\node_modules\abbrev'                                                                                                                                                                      
npm ERR! enoent ENOENT: no such file or directory, rename 'c:\repos\test\test-web\node_modules\.staging\abbrev-a166e773' -> 'c:\repos\test\test-web\node_modules\ember-cli\node_m
odules\npm\node_modules\abbrev'                                                                                                                                                                      
npm ERR! enoent This is most likely not a problem with npm itself                                                                                                                                    
npm ERR! enoent and is related to npm not being able to find a file.                                                                                                                                 
npm ERR! enoent                                                                                                                                                                                      

npm ERR! Please include the following file with any support request:                                                                                                                                 
npm ERR!     c:\repos\test\test-web\npm-debug.log     

masaanli avatar Aug 08 '16 05:08 masaanli

For the sake of a sanity test, would you try updating to node 6.3.1 and latest npm and see if this is still an issue for you. Probably best to do a fresh install and package creation just to confirm this is braking out of the box.

npm install angular-cli@webpack -g ng new foo cd ./foo ng build

TheLarkInn avatar Aug 12 '16 04:08 TheLarkInn

@achintverma you're using beta.10 instead of the webpack version.

@masaanli you're using the webpack version but you're trying to just double click index.html. This does not work unless you correctly configure the base tag in index.html. This is not trivial and would most likely not work at all with routing. I suggest you use ng serve to serve your project instead.

Regarding the pm ERR! enoent ENOENT: no such file or directory, rename ... errors, these most commonly happen when you have VSCode open. It sometimes keeps locks on some directories and breaks npm install. Try closing VSCode and it should work.

filipesilva avatar Aug 18 '16 03:08 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.