I downloaded the free template for a single-page application with ASP.Net Core 2.x and EntityFramework Core 2.x. version 3.9.0.
After unpacking the archive, I did not found the project ProjectName.Web.MVC in the solution. If I understand correctly, I need to somehow generate it. But neither on the official documentation site, nor here I found a single word about how to do it. There is a file 3.9.0/aspnet-core/build/build-mvc.ps1 in the archive, maybe I need to use it somehow?
How to compile/generate/create an ProjectName.Web.MVC project for using Vue.js?
I solved this problem as follows.
First, need to understand that when you debug/start a project in VisualStudio, only WebAPI starts. To start vue, you need installed Node.js, Yarn and following npm packages like so:
npm install -g webpack, vue-cli, babel-cli, babel-preset-env
If any packages are redundant, then tell me in comments.
After that, I started the project from VisualStudio and called following NPM commands in the console in vue folder npm install --save-dev. After this dependencies loaded to node_modules folder. At last run npm command npm run serve. Now vue available at URL http://localhost:8080.
Related
The Problem
On an existing Angular 5x application, I want to upgrade to Angular v8x and take advantage of all the sexy things, including ng generate component. I successfully modified the code to satisfy v8, and changed the npm packages correctly; the app runs (whoo-hoo!). Now, I can't get the Angular cli to work because of missing files like angular.json.
Things I've tried
Using ng new
ng new will create the project files I need, but I didn't want to overwrite my existing code, e.g. app.module.ts, so I ran
ng new my-app --directory [existing source directory of my app]
That overwrote many files, package.json, app.module.ts,etc, so I ran int again as:
ng new revenue --directory=./ --create-application=false --force
A lot of files were preserved, but package.json was not.
The Goal
Have my now upgraded app, running Angular v8, able to run fun things like ng serve
Not have to re-write package.json
Thanks for your help!
Upgrading to Angular 8 should modify package.json.
People typically use ng update to do this (link).
Updating Configuration Files
There are many differences between Angular 4|5 and Angular 6 such as
Angular 6 uses angular.json instead of angular-cli.json.
Different versions of dependencies in package.json etc.
You can update different configuration files automatically by running the following command from the project's root folder:
ng update #angular/cli
What is the ng update Command?
Ng update is a command available in Angular CLI which is used to update your application and its dependencies. You can use it to update all packages in the package.json file via the --all option that could take true or false or specific versions via the --packages option. You can see all the available commands from the official docs.
I ended up creating a brand-new application with ng new my-app, then copying over the files from the existing app. After modifying the code to work with Angular 8, using HttpClient, for example, the app successfully ran. I think I had to do it this way because of the fundamental changes to the project meta files. Hopefully, future upgrades won't be so challenging.
I am currently looking at deploying a personal project to Netlify. This project uses an npm package called NES.css which is found here: https://nostalgic-css.github.io/NES.css/.
I have a gulp file that has a build process that minifies, bundles, transpiles all the scss, js, images, etc. This is done by running npm build.
Netlify is setup to run this build command on deploy. Everything works as far as deploying goes, however, there are two images that the NES.css's stylesheet references that are no longer found because Netlify deletes the node modules before deploying your code. Any suggestions?
Since nes.css just gives you a css to play with, you can easily fetch the css elements into your HTML via CDN by including following in the
Bonus: With the above method, you don't need to worry about updating your nes.css npm module every time the original nes GitHub project gets an update.
I have just started learning Vue.js. The author is using npm install -g vue-cli but it did not work with me because I got stuck with technical issues and I tried many solutions to fix it but I couldn't.
So I want to follow up with the author but using npm install -g #vue/cli. So Do you think I it will be easy to follow up with him? I mean are these different versions use different syntax?
The vue-cli package seems to be the old cli. The main difference between this version and Vue CLI 3 is that the webpack configuration used to be visible in the project as a build directory. To make changes to the build process you used to have to modify files within this folder. In Vue CLI 3 this has been moved to a helper that consumes a configuration file vue.config.js in the project. The structure of files has been slightly altered in this version of the CLI. Both work with Vue 2.x, so the way you write .vue files has not changed in any way.
Overall you should have little trouble following the tutorial, unless you are going to make changes to the build process. In that case, simply consult the official documentation or find a tutorial that is specifically for Vue CLI 3.
I am working on a project with dotnet core, in Linux and it is using MVC.
I am reading a book for learning how to put things together. The book advises installing Bower. But the last time I researched bower I believe they were advising towards using something else for new projects.
I would like to know what alternative I can use for front end management. I need to be able to use Bootstrap, Jquery, Popper and Datatables on my page. And of course, I should be able to use it in Linux.
Thanks for the help francium. NPM is working just fine.It is in the official Ubuntu repository. You have to install popper the following way though: npm install popper.js --save
If you don't specify the .js extension it will give you a warning saying that bootstrap requires a popper installation but it was not installed. You also have to install git on your machine to make it work. I did not do it the first time I ran it and it gave me an error asking me if it was installed. Thanks for the suggestion, It was relatively easy to do get things working.
Yarn is now the alternative to Bower, but to install Yarn you need to use NPM
According to the docs, Titanium now has support to install npm packages: http://docs.appcelerator.com/platform/latest/#!/guide/Node.js_Support
However, upon reading it, I am very confused as to where to actually put my node_modules directory. There is some mention in the docs about a Resources directory, however, for Alloy this is supposed to be left empty, as it is frequently overwritten by the compiler.
So my question is, where do I put my node_modules and how do I reference it.
In Alloy project you are supposed to run npm install inside the app folder. But according to this bug JIRA Ticket modules that use core-modules won't work correctly. So you have to try if you module works.
Another explanation: https://stackoverflow.com/a/45041737/5193915
From experimentation, it seems like you can do npm install in the app/lib/ so your package are in app/lib/node_modules. This does NOT work on the app/ directory.
Note that if you use tishadow, you will also need to install the npm packages there as well in the Resources/ directory (as they still do not use the Alloy framework).