2
I installed @angular/cli like this:
npm install -g @angular/cli
I created a project like this:
ng new name-project
So far so good, but there is the possibility that when you create a project with eating ng new it does not copy the @Angula folder to location, but it uses the one from the global repository?
Reason for the question:
A clean design with only the angular has approximately 28,000 files with the total size of approximately 200 MB, to backup takes a lot, out it consumes hard disk space. I would like to unify the packages that are possible in the global repository and whenever I create my projects they will access the libraries there because all the projects will have the same versions of the libraries and if I update one all the projects will be updated.
===========================================================================
I ran the following lines on CMD simulating a project from scratch.
I created a folder Projects and inside it I made the commands:
mkdir node_modules
echo {} >> package.json
npm i @angular/cli --save
ng new projeto1 --skip-install
at the end presented the following message when I used ng new project1
"You cannot use the new command Inside an Angular CLI project."
If I use: "npm install jquery --save" inside my project folder, how will it include links/dependencies with modules that are in another package.json outside of my project folder? Note: I am using Visual Studio Code on Windows 10
– Joandreiy Cordeiro
@Joandreiycordeiro you must run the command inside the directory that contains the file
package.json
, and this file should manage thenode_modules
which is shared between projects. In the example I provided, you should run this command at the root of the directorymeus-projetos
– mercador
I did the following: I ran the following lines in CMD simulating a project from scratch. I created a Projects folder and inside it I did the commands: mkdir node_modules echo {} >> package.json npm i @angular/cli --save ng new project1 --Skip-install at the end presented the following message when I used ng new project1 "You cannot use the new command Inside an Angular CLI project."
– Joandreiy Cordeiro