Unable to create new project on mac


For some reason I am now unable to create a new project.
I’m running:

tns create HelloWorld --template nativescript-template-tutorial

And getting back as result:

Installing  nativescript-template-tutorial
Error: Command npm install nativescript-template-tutorial@3.1.0 --silent --save-exact --save failed with exit code 1
# create

My node version is v7.8.0. What went wrong?


Hello @developer82
Can you run the same comannd but add "–log trace " at the end?

So the full command would be:

tns create HelloWorld --template nativescript-template-tutorial --log trace

Then post the output here


This is what I’m getting:

Installing  nativescript-template-tutorial
spawn: npm "install" "nativescript-template-tutorial@3.1.0" "--silent" "--save-exact" "--save"
Error: Command npm install nativescript-template-tutorial@3.1.0 --silent --save-exact --save failed with exit code 1
    at ChildProcess.childProcess.on (/usr/local/lib/node_modules/nativescript/lib/node-package-manager.js:214:36)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:509:12)
Error: Error: Command npm install nativescript-template-tutorial@3.1.0 --silent --save-exact --save failed with exit code 1
    at NpmInstallationManager.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:54:23)
    at Generator.throw (<anonymous>)
    at rejected (/usr/local/lib/node_modules/nativescript/lib/npm-installation-manager.js:5:65)
Analytics statuses: 
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'help'.
List of registered commands: /?, appstore, appstore|upload, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, clean-app, clean-app|android, clean-app|ios, create, debug, debug|android, debug|ios, deploy, dev-generate-help, dev-generate-messages, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, devices, devices|android, devices|ios, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, error-reporting, extension, extension|install, extension|uninstall, help, info, init, install, platform, platform|add, platform|clean, platform|remove, platform|update, plugin, plugin|add, plugin|install, plugin|remove, plugin|update, post-install-cli, prepare, proxy, proxy|clear, proxy|set, publish, publish|ios, run, run|android, run|ios, test, test|android, test|init, test|ios, update, usage-reporting
Reading help for command 'create'. FileName is 'create.md'.


[ps: i don’t know if my answer is correct, i am just trying to give my point of view of the problem and what i consider to be the solution, i apologize in advance if i say something that seems odd or incorrect]

I think the error is due to the lack of permissions.

set unsafe-perm to true when running as sudo -> this is a fix to the permission obstructing

So just add the flag


to your earlier command and try to see if you can fix the problem.


Unfortunately this did not help :frowning:
I recently upgraded my NPM. Does this have anything to do with it? What NPM do you have running on your environment?


Was able to solve this. I completely uninstalled node and npm and reinstalled - everything works now!