jeudi 16 mars 2017

Is it right to try moving my front end packages from bower to npm?

I am quite new to ember and was trying to build a small to-do list app when I started facing a problem wherein I tried installing moment package through bower install moment but somehow importing the package into ember-cli-build.js didn't work out. I came across a solution that said I should runnpm install moment over it and that worked for me. Following above events I tried removing the moment package from bower_components and changing the path to node_modules. This didn't work out though and broke my app instead. I was getting the following error:

The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with: 

Error: ENOENT: no such file or directory, open '/Users/kshitij/scratch/ember-projects/em-app/tmp/source_map_concat-input_base_path-http://ift.tt/2n3kVFt  

My question: Is trying moving bower packages to npm correct? If yes, then why it doesn't work out in this case?

Note: I could also have solved the problem by adding "moment" to "predef" block of .jshint.rc file in the application directory but I want to know why the npm method worked out and why porting the moment package entirely from bower to npm doesn't work.




Aucun commentaire:

Enregistrer un commentaire