0

On my Windows 10 64-bit laptop, I have successfully created an angular 8 app using following command:

C:\Angular> ng new angular-hello-world

This installed all necessary files and packages from the internet under C:\Angular\angular-helllo-world.

Now, I want to create another angular 8 application but without using the above command since I have internet issues on my end. I am tempted to do the following to create this app, but not sure if it would cause some issues other than not getting the latest npm packages.

  1. Run the following command to create application folder:

    C:\Angular> md angular-new-app

  2. Run following command as an Administrator to copy all folders/files from existing angular-hello-world folder to angular-new-app folder including all permissions/security from source folder:

    C:\Angular> xcopy c:\Angular\angular-hello-world c:\Angular\angular-new-app /O /X /E /H /K

Question: Would above approach of xcopy work or there are some hidden subtle issues when doing this?

Sunil
  • 20,653
  • 28
  • 112
  • 197
  • You need to do 'npm install' later. Take note that copying node_modules directory isn't necessary – Alex Sep 21 '19 at 06:05
  • @Adam, But if I do npm install then that will use the internet and I have issues with my internet as its not stable. – Sunil Sep 21 '19 at 06:06
  • 2
    When you copy the entire folder it will just work. You could have easily tried it out. – Silvermind Sep 21 '19 at 06:09
  • I think another option is to use yarn instead of npm, since the home page of yarn at https://yarnpkg.com/en/ says that it can install packages in offline mode so no internet connection is required. I think npm does not do this by default. – Sunil Sep 21 '19 at 07:29
  • @Adam, If node-modules folder is not created in an angular app, then the npm packages need to be installed globally using `npm install -g`. Is that right? – Sunil Sep 21 '19 at 07:35
  • 1
    @Sunil, global install puts stuff in /usr/local or wherever node is installed, as you can see here: https://docs.npmjs.com/files/folders. About installing node packages without internet connection I recommend you to visit this topic: https://stackoverflow.com/questions/23250805/how-to-install-nodejs-project-locally-without-internet-connection – Alex Sep 21 '19 at 11:07

0 Answers0