Skip to content

"TypeError: Path must be a string." on npm i -g nativescript #2791

@BeatPots

Description

@BeatPots

Hello to everybody!
I'm a bit frustrated for the NativeScript installation on my Mac OSX Sierra . .

I have read and followed the 'NativeScript Advanced Setup: macOS' on http://docs.nativescript.org/start/ns-setup-os-x#system-requirements.

I have a problem on 'npm i -g nativescript': there is an error after the 'Exec xcodebuild -version' (see the tns doctor log below), 'TypeError: Path must be a string. Received undefined'.

As you have understood, I'm new on NativeScript.

What can I do??
Tnx to everybody!

Some information:
tns --version: 3.0.0
node --version: v7.10.0

tns doctor --log trace:
Loading extensions.
Exec uname -a
stdout: Darwin Adrianos-MacBook-Pro.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

stderr:
Exec npm -v
stdout: 4.2.0

stderr:
spawn: java "-version"
Exec node-gyp -v
stdout:
stderr: /bin/sh: node-gyp: command not found

Exec xcodebuild -version
stdout: Xcode 8.3.2
Build version 8E2002

stderr:
Exec gem which xcodeproj
stdout: /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.4/lib/xcodeproj.rb

stderr:
Exec pod --version
stdout: 1.2.1

stderr:
Exec null version
stdout:
stderr: /bin/sh: null: command not found

spawn: emulator "-help"
Result when throw error is false:
{ stdout: 'Android Emulator usage: emulator [options] [-qemu args]\n options:\n -list-avds list available AVDs\n -sysdir

search for system disk images in \n -system read initial system image from \n -writable-system make system image writable after 'adb remount'\n -datadir write user data into \n -kernel use specific emulated kernel\n -ramdisk ramdisk image (default /ramdisk.img\n -image obsolete, use -system instead\n -initdata same as '-init-data '\n -data data image (default /userdata-qemu.img\n -partition-size system/data partition size in MBs\n -cache cache partition image (default is temporary file)\n -cache-size cache partition size in MBs\n -no-cache disable the cache partition\n -nocache same as -no-cache\n -sdcard SD card image (default /sdcard.img\n -snapstorage file that contains all state snapshots (default /snapshots.img)\n -no-snapstorage do not mount a snapshot storage file (this disables all snapshot functionality)\n -snapshot name of snapshot within storage file for auto-start and auto-save (default 'default-boot')\n -no-snapshot perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage\n -no-snapshot-save do not auto-save to snapshot on exit: abandon changed state\n -no-snapshot-load do not auto-start from snapshot: perform a full boot\n -snapshot-list show a list of available snapshots\n -no-snapshot-update-time do not do try to correct snapshot time on restore\n -wipe-data reset the user data image (copy it from initdata)\n -avd use a specific android virtual device\n -skindir search skins in (default /skins)\n -skin select a given skin\n -no-skin deprecated: create an AVD with no skin instead\n -noskin same as -no-skin\n -memory physical RAM size in MBs\n -accel Configure emulation acceleration\n -no-accel Same as '-accel off'\n -ranchu Use new emulator backend instead of the classic one\n -engine Select engine. auto|classic|qemu2\n -netspeed maximum network download/upload speeds\n -netdelay network latency emulation\n -netfast disable network shaping\n -code-profile enable code profiling\n -show-kernel display kernel messages\n -shell enable root shell on current terminal\n -no-jni disable JNI checks in the Dalvik runtime\n -nojni same as -no-jni\n -logcat enable logcat output with given tags\n -no-audio disable audio support\n -noaudio same as -no-audio\n -audio use specific audio backend\n -raw-keys disable Unicode keyboard reverse-mapping (deprecated)\n -radio redirect radio modem interface to character device\n -port TCP port that will be used for the console\n -ports , TCP ports used for the console and adb bridge\n -onion

use overlay PNG image over screen\n -onion-alpha <%age> specify onion-skin translucency\n -onion-rotation 0|1|2|3 specify onion-skin rotation\n -dpi-device specify device's resolution in dpi (default 165)\n -scale scale emulator window (deprecated)\n -http-proxy make TCP connections through a HTTP/HTTPS proxy\n -timezone use this timezone instead of the host's default\n -dns-server use this DNS server(s) in the emulated system\n -cpu-delay throttle CPU emulation\n -no-boot-anim disable animation for faster boot\n -no-window disable graphical window display\n -version display emulator version number\n -report-console report console port to remote socket\n -gps redirect NMEA GPS to character device\n -keyset specify keyset file name\n -shell-serial specific character device for root shell\n -tcpdump capture network packets to file\n -bootchart enable bootcharting\n -charmap use specific key character map\n -prop = set system property on boot\n -shared-net-id join the shared network, using IP address 10.1.2.\n -nand-limits enforce NAND/Flash read/write thresholds\n -gpu set hardware OpenGLES emulation mode\n -camera-back set emulation mode for a camera facing back\n -camera-front set emulation mode for a camera facing front\n -webcam-list lists web cameras available for emulation\n -screen set emulated screen mode\n -force-32bit always use 32-bit emulator\n -selinux <disabled|permissive> Set SELinux to either disabled or permissive mode\n -unix-pipe Add to the list of allowed Unix pipes\n -fixed-scale Use fixed 1:1 scale for the initial emulator window.\n\n -qemu args... pass arguments to qemu\n -qemu -h display qemu help\n\n -verbose same as '-debug-init'\n -debug enable/disable debug messages\n -debug- enable specific debug messages\n -debug-no- disable specific debug messages\n\n -help print this help\n -help- print option-specific help\n\n -help-disk-images about disk images\n -help-keys supported key bindings\n -help-debug-tags debug tags for -debug \n -help-char-devices character specification\n -help-environment environment variables\n -help-keyset-file key bindings configuration file\n -help-virtual-device virtual device management\n -help-sdk-images about disk images when using the SDK\n -help-build-images about disk images when building Android\n -help-all prints all help content\n\n',
stderr: '',
exitCode: 1 }
The result of checking is Android Emulator installed is:

  • stdout: Android Emulator usage: emulator [options] [-qemu args]
    options:
    -list-avds list available AVDs
    -sysdir

    search for system disk images in
    -system read initial system image from
    -writable-system make system image writable after 'adb remount'
    -datadir write user data into
    -kernel use specific emulated kernel
    -ramdisk ramdisk image (default /ramdisk.img
    -image obsolete, use -system instead
    -initdata same as '-init-data '
    -data data image (default /userdata-qemu.img
    -partition-size system/data partition size in MBs
    -cache cache partition image (default is temporary file)
    -cache-size cache partition size in MBs
    -no-cache disable the cache partition
    -nocache same as -no-cache
    -sdcard SD card image (default /sdcard.img
    -snapstorage file that contains all state snapshots (default /snapshots.img)
    -no-snapstorage do not mount a snapshot storage file (this disables all snapshot functionality)
    -snapshot name of snapshot within storage file for auto-start and auto-save (default 'default-boot')
    -no-snapshot perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage
    -no-snapshot-save do not auto-save to snapshot on exit: abandon changed state
    -no-snapshot-load do not auto-start from snapshot: perform a full boot
    -snapshot-list show a list of available snapshots
    -no-snapshot-update-time do not do try to correct snapshot time on restore
    -wipe-data reset the user data image (copy it from initdata)
    -avd use a specific android virtual device
    -skindir search skins in (default /skins)
    -skin select a given skin
    -no-skin deprecated: create an AVD with no skin instead
    -noskin same as -no-skin
    -memory physical RAM size in MBs
    -accel Configure emulation acceleration
    -no-accel Same as '-accel off'
    -ranchu Use new emulator backend instead of the classic one
    -engine Select engine. auto|classic|qemu2
    -netspeed maximum network download/upload speeds
    -netdelay network latency emulation
    -netfast disable network shaping
    -code-profile enable code profiling
    -show-kernel display kernel messages
    -shell enable root shell on current terminal
    -no-jni disable JNI checks in the Dalvik runtime
    -nojni same as -no-jni
    -logcat enable logcat output with given tags
    -no-audio disable audio support
    -noaudio same as -no-audio
    -audio use specific audio backend
    -raw-keys disable Unicode keyboard reverse-mapping (deprecated)
    -radio redirect radio modem interface to character device
    -port TCP port that will be used for the console
    -ports , TCP ports used for the console and adb bridge
    -onion use overlay PNG image over screen
    -onion-alpha <%age> specify onion-skin translucency
    -onion-rotation 0|1|2|3 specify onion-skin rotation
    -dpi-device specify device's resolution in dpi (default 165)
    -scale scale emulator window (deprecated)
    -http-proxy make TCP connections through a HTTP/HTTPS proxy
    -timezone use this timezone instead of the host's default
    -dns-server use this DNS server(s) in the emulated system
    -cpu-delay throttle CPU emulation
    -no-boot-anim disable animation for faster boot
    -no-window disable graphical window display
    -version display emulator version number
    -report-console report console port to remote socket
    -gps redirect NMEA GPS to character device
    -keyset specify keyset file name
    -shell-serial specific character device for root shell
    -tcpdump capture network packets to file
    -bootchart enable bootcharting
    -charmap use specific key character map
    -prop = set system property on boot
    -shared-net-id join the shared network, using IP address 10.1.2.
    -nand-limits enforce NAND/Flash read/write thresholds
    -gpu set hardware OpenGLES emulation mode
    -camera-back set emulation mode for a camera facing back
    -camera-front set emulation mode for a camera facing front
    -webcam-list lists web cameras available for emulation
    -screen set emulated screen mode
    -force-32bit always use 32-bit emulator
    -selinux <disabled|permissive> Set SELinux to either disabled or permissive mode
    -unix-pipe Add to the list of allowed Unix pipes
    -fixed-scale Use fixed 1:1 scale for the initial emulator window.

    -qemu args... pass arguments to qemu
    -qemu -h display qemu help

    -verbose same as '-debug-init'
    -debug enable/disable debug messages
    -debug- enable specific debug messages
    -debug-no- disable specific debug messages

    -help print this help
    -help- print option-specific help

    -help-disk-images about disk images
    -help-keys supported key bindings
    -help-debug-tags debug tags for -debug
    -help-char-devices character specification
    -help-environment environment variables
    -help-keyset-file key bindings configuration file
    -help-virtual-device virtual device management
    -help-sdk-images about disk images when using the SDK
    -help-build-images about disk images when building Android
    -help-all prints all help content

  • stderr:
    Exec mono --version
    stdout:
    stderr: /bin/sh: mono: command not found

Exec git --version
stdout: git version 2.11.0 (Apple Git-81)

stderr:
Exec gradle -v
stdout:
stderr: /bin/sh: gradle: command not found

Exec "javac" -version
stdout:
stderr: javac 1.8.0_131

System information:
{ procInfo: 'nativescript/3.0.0',
platform: 'darwin',
os: 'Darwin Adrianos-MacBook-Pro.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64\n',
shell: '/bin/bash',
dotNetVer: null,
procArch: 'x64',
nodeVer: 'v7.10.0',
npmVer: '4.2.0',
javaVer: '1.8.0',
nodeGypVer: null,
xcodeVer: 'Xcode 8.3.2\nBuild version 8E2002\n',
xcodeprojGemLocation: '/Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.4/lib/xcodeproj.rb\n',
itunesInstalled: true,
cocoapodVer: '1.2.1',
adbVer: null,
emulatorInstalled: true,
monoVer: null,
gitVer: '2.11.0 (Apple Git-81)',
gradleVer: null,
javacVersion: '1.8.0_131' }
Looking for project in '/Users/adriano.marchi'
Looking for project in '/Users'
Looking for project in '/'
No project found at or above '/Users/adriano.marchi'.
Unable to find project. projectDir: null, options.path: undefined, /Users/adriano.marchi
No project found at or above '%s' and neither was a --path specified.
Initializing analytics statuses.
Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'doctor'.
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements

TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.

Verifying CocoaPods. This may take more than a minute, please be patient.
spawn: npm "install" "tns-ios" "--global" "false" "--ignore-scripts" "--production" "--save"
nativescript-check-cocoapods@0.0.1 /private/var/folders/jt/1tdb488x4gq6yyjvbd791s7w0000gn/T/nativescript-check-cocoapods11749-8984-1bopjmg.c4i4g6i529
└── tns-ios@3.0.0

npm WARN nativescript-check-cocoapods@0.0.1 No description
npm WARN nativescript-check-cocoapods@0.0.1 No repository field.
npm WARN nativescript-check-cocoapods@0.0.1 No license field.
◡ Installing iOS runtime.
spawn: pod "install"
◞ Verifying CocoaPods. This may take some time, please be patient.Result when throw error is false:
{ stdout: 'Analyzing dependencies\nDownloading dependencies\nInstalling AFNetworking (1.3.4)\nGenerating Pods project\nIntegrating client project\n\n[!] Please close any current Xcode sessions and use __PROJECT_NAME__.xcworkspace for this project from now on.\nSending stats\nPod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.\n',
stderr: '\n[!] Automatically assigning platform ios with version 8.0 on target PROJECT_NAME because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.\n',
exitCode: 0 }
◠ Verifying CocoaPods. This may take some time, please be patient.
Exec xcodebuild -version
stdout: Xcode 8.3.2
Build version 8E2002

stderr:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1211:7)
at AndroidToolsInfo.getInstalledTargets (/usr/local/lib/node_modules/nativescript/lib/android-tools-info.js:266:45)
at AndroidToolsInfo.descriptor.(anonymous function) (/usr/local/lib/node_modules/nativescript/lib/common/decorators.js:19:40)
at AndroidToolsInfo.getLatestValidAndroidTarget (/usr/local/lib/node_modules/nativescript/lib/android-tools-info.js:258:37)
at AndroidToolsInfo.getCompileSdkVersion (/usr/local/lib/node_modules/nativescript/lib/android-tools-info.js:188:53)
at AndroidToolsInfo.getToolsInfo (/usr/local/lib/node_modules/nativescript/lib/android-tools-info.js:37:47)
at AndroidToolsInfo.descriptor.(anonymous function) (/usr/local/lib/node_modules/nativescript/lib/common/decorators.js:19:40)
at AndroidToolsInfo.validateInfo (/usr/local/lib/node_modules/nativescript/lib/android-tools-info.js:49:34)
at DoctorService. (/usr/local/lib/node_modules/nativescript/lib/services/doctor-service.js:96:61)
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, emulate, emulate|android, emulate|ios, 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 'doctor'. FileName is 'doctor.md'.

doctor

┌─────────┬──────────────┐
│ Usage │ Synopsis │
│ General │ $ tns doctor │
└─────────┴──────────────┘

Checks your system for configuration problems which might prevent the NativeScript CLI from working properly.__

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions