Skip to content

Running tns create project-name fails in 1.2 #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bfattori opened this issue Jul 30, 2015 · 6 comments
Closed

Running tns create project-name fails in 1.2 #724

bfattori opened this issue Jul 30, 2015 · 6 comments

Comments

@bfattori
Copy link

@vchimev I have now followed every bit of information you have all pointed me to. I'm getting irritated that every single issue I submit is being closed with a "refer to this document" link.

I have run tns create my-project and it fails miserably compared to < 1.2.0 versions. It creates a broken project which is missing app/App_Resources and app/tns_modules. When I try the command tns run android --emulator it fails in the ANT script with a null returned: 1 error.

@bfattori
Copy link
Author

I'm not sure if I understand nativescript-cli at this point, but it looks like it's trying to get tns-template-hello-world from npm. Possibly there is a proxy issue or maybe a bad file in the repo?

@dtopuzov
Copy link
Contributor

Yes, create command get tns-template-hello-world and it looks this fails on your environment.
File should be OK because we can not reproduce the problem.
Regarding proxy issue - yes it is possible.
Can you please try "tns create TestApp --log trace" and send logs.

@rosen-vladimirov
Copy link
Contributor

Hi @bfattori
I think your problem could be caused by two reasons:

  1. Most probably your npm cache is in inconsistent state and the tns-template-hello-world in it, does not have all the required files. When you try creating new project, npm is checking the cache, finds the cached version and it is using it instead of downloading it. In order to check if this is the case, please clean your cache and execute tns create my-project. This will download the template once again in the cache and this time it should work fine. You can check where your npm cache is by running npm config get cache - delete everything from this directory.
  2. The other problem that might occur is working behind proxy. If the above solution did not help, you can try configuring proxy settings. Just follow the instructions here.
    Hope this helps. I'm looking forward to hearing from you.

@bfattori
Copy link
Author

That sounds reasonable. @dtopuzov, here's the log:

Exec npm -v 
 stdout: 2.5.1

 stderr: 
spawn: java -version
Exec ant -version 
 stdout: Apache Ant(TM) version 1.9.4 compiled on April 29 2014

 stderr: 
Exec node-gyp -v 
 stdout:  
 stderr: 'node-gyp' is not recognized as an internal or external command,
operable program or batch file.

Exec adb version 
 stdout: Android Debug Bridge version 1.0.32

 stderr: 
Exec android -h 
 stdout: 
       Usage:
       android [global options] action [action options]
       Global options:
  -h --help       : Help on a specific command.
  -v --verbose    : Verbose mode, shows errors, warnings and all messages.
     --clear-cache: Clear the SDK Manager repository manifest cache.
  -s --silent     : Silent mode, shows errors only.

                                                                    Valid
                                                                    actions
                                                                    are
                                                                    composed
                                                                    of a verb
                                                                    and an
                                                                    optional
                                                                    direct
                                                                    object:
-    sdk              : Displays the SDK Manager window.
-    avd              : Displays the AVD Manager window.
-   list              : Lists existing targets or virtual devices.
-   list avd          : Lists existing Android Virtual Devices.
-   list target       : Lists existing targets.
-   list device       : Lists existing devices.
-   list sdk          : Lists remote SDK repository.
- create avd          : Creates a new Android Virtual Device.
-   move avd          : Moves or renames an Android Virtual Device.
- delete avd          : Deletes an Android Virtual Device.
- update avd          : Updates an Android Virtual Device to match the folders
                        of a new SDK.
- create project      : Creates a new Android project.
- update project      : Updates an Android project (must already have an
                        AndroidManifest.xml).
- create test-project : Creates a new Android project for a test package.
- update test-project : Updates the Android project for a test package (must
                        already have an AndroidManifest.xml).
- create lib-project  : Creates a new Android library project.
- update lib-project  : Updates an Android library project (must already have
                        an AndroidManifest.xml).
- create uitest-project: Creates a new UI test project.
- update adb          : Updates adb to support the USB devices declared in the
                        SDK add-ons.
- update sdk          : Updates the SDK by suggesting new platforms to install
                        if available.

 stderr: 
Exec mono --version 
 stdout:  
 stderr: 'mono' is not recognized as an internal or external command,
operable program or batch file.

System information:
{ procInfo: 'nativescript/1.2.1',
  platform: 'win32',
  os: 'Windows 7 Enterprise 6.1.7601',
  shell: 'C:\\windows\\system32\\cmd.exe',
  dotNetVer: '4.5.51209',
  procArch: 'x64',
  nodeVer: 'v0.12.0',
  npmVer: '2.5.1',
  javaVer: 'Java HotSpot(TM) Client VM (build 25.40-b25, mixed mode, sharing)',
  antVer: 'Apache Ant(TM) version 1.9.4 compiled on April 29 2014',
  nodeGypVer: null,
  xcodeVer: null,
  itunesInstalled: false,
  adbVer: 'Android Debug Bridge version 1.0.32',
  androidInstalled: true,
  monoVer: null }
Starting watch on killswitch C:\Users\fat624\AppData\Local\Temp\fat624\KillSwitches\cli
Initializing analytics statuses.
Analytics statuses: 
{ TrackFeatureUsage: 0, null: 0 }
Trying to track feature 'Non-interactive' with value 'create'.
AnalyticsInstallationID: 322bfd96-6423-41b7-991c-e7ecb85a8c3e
monitor not started
monitor not started
monitor has started, connecting to http://5752dabccfc54c4ab82aea9626b7338e.monitor-eqatec.com/json.ashx
Creating a new NativeScript project with name canvas-polyfill and id org.nativescript.canvaspolyfill at location C:\work\NativeScript\canvas-polyfill
Using NativeScript hello world application
Statistics was sent successfully (xhr).
Statistics was sent successfully (xhr).
Using version 1.2.0. 
Copying NativeScript hello world application into C:\work\NativeScript\canvas-polyfill\app
Project canvas-polyfill was successfully created

@bfattori
Copy link
Author

That was the answer. @rosen-vladimirov, I would suggest putting something in the "Troubleshooting" or "FAQ" section of the documentation, and linking to it from the installation instructions. Then people won't pull their hair out like I did.

Thanks for your help!

@rosen-vladimirov
Copy link
Contributor

@bfattori in fact we are working on additional checks when using the template from npm cache that will prevent such errors in the future, but thank you for your feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants