Couldn't create angular project in version 3.1.3


#1

Hello,

After testing Nativescript applications on windows , I started my venture on Mac OS. But I am not able to create angular project. I am novice to Mac OS is another added disadvantage to solve issue. I could able to create normal vanilla project (without angular) but couldn’t create angular one. I had listed log of operation in below Preformatted text.

tns version is 3.1.3 and Mac OS Sierra 10.12.4

`bash-3.2$ sudo tns create demo
Installing tns-template-hello-world
/Users/niketan.mhatre/nativescript/demo
└─┬ tns-template-hello-world@3.1.0
└── nativescript-theme-core@1.0.4

Installing tns-core-modules
/Users/niketan.mhatre/nativescript/demo
└─┬ tns-core-modules@3.1.0
└── tns-core-modules-widgets@3.1.0

Project demo was successfully created.

bash-3.2$ sudo tns create demong --ng
Installing tns-template-hello-world-ng
fs.js:923
return binding.mkdir(pathModule._makeLong(path),
^

Error: EACCES: permission denied, mkdir '/Users/niketan.mhatre/nativescript/demong/hooks’
at Error (native)
at Object.fs.mkdirSync (fs.js:923:18)
at Object. (/Users/niketan.mhatre/nativescript/demong/node_modules/nativescript-angular/postinstall.js:11:12)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
/Users/niketan.mhatre/nativescript/demong
├── @angular/animations@4.1.3 extraneous
├── @angular/common@4.1.3 extraneous
├── @angular/compiler@4.1.3 extraneous
├── @angular/core@4.1.3 extraneous
├── @angular/forms@4.1.3 extraneous
├── @angular/http@4.1.3 extraneous
├── @angular/platform-browser@4.1.3 extraneous
├── @angular/router@4.1.3 extraneous
├── nativescript-theme-core@1.0.4 extraneous
├── reflect-metadata@0.1.10 extraneous
├── rxjs@5.3.3 extraneous
├── tns-core-modules@3.1.0 extraneous
└── zone.js@0.8.16 extraneous

Command npm install tns-template-hello-world-ng@3.1.1 --silent --save-exact --save failed with exit code 1

create

┌───────────────┬────────────────────────────────────────────────────────────┐
│ Usage │ Synopsis │
│ Create from │ $ tns create [–path ] [–appid <App │
│ default │ ID>] │
│ JavaScript │ │
│ template │ │
│ Create from │ $ tns create --template typescript [–path │
│ default │ ] [–appid ] OR $ tns create │
│ TypeScript │ --tsc [–path ] [–appid ] OR $ │
│ template │ tns create --template tsc [–path ] │
│ │ [–appid ] │
│ Create from │ $ tns create --template angular [–path │
│ default │ ] [–appid ] OR $ tns create │
│ Angular │ --template ng [–path ] [–appid ] │
│ template │ OR $ tns create --ng [–path ] [- │
│ │ -appid ] │
│ Copy from │ $ tns create [–path ] [–appid <App │
│ existing │ ID>] │
│ project │ │
│ Create from │ $ tns create [–path ] [–appid <App │
│ custom │ ID>] --template │
│ template │ │
└───────────────┴────────────────────────────────────────────────────────────┘

Creates a new project for native development with NativeScript.

Options

* --path - Specifies the directory where you want to create the project, if different from the current directory. The directory must be empty.
* --appid - Sets the application identifier for your project.
* --template - Specifies a valid npm package which you want to use to create your project. If --template is not set, the NativeScript CLI creates the project from the default JavaScript hello-world template.
* --ng - Sets the template for your project to the Angular template.
* --tsc - Sets the template for your project to the TypeScript template.

Attributes

* <App Name> is the name of project. The specified name must meet the requirements of all platforms that you want to target. For more information about the <App Name> requirements, run $ tns help create
* <App ID> is the application identifier for your project. It must be a domain name in reverse and must meet the requirements of all platforms that you want to target. If not specified, the application identifier is set to org.nativescript.<App name> For more information about the <App ID> requirements, run $ tns help create

bash-3.2$
`

Any help will be appreciated.


#2

Why are you using sudo?

I don’t understand why you’re getting an permission denied on that. But try removing the project folder completely and run the command without sudo?