nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Node modules missing when running 'tns platform add android'

Open N3ll opened this issue 11 years ago • 3 comments

From @arlowhite on November 12, 2015 21:32

I installed node with nvm Node v4.2.1 npm 3.3.12

Installed NativeScript with: npm install nativescript -g

When I tried 'tns platform add android', I got errors for missing modules, starting with:

Cannot find module 'child-process-close'

I had to install all of these modules for the command to finally work.

npm install -g child-process-close
npm install -g config-chain
npm install -g nopt
npm install -g umask
npm install -g npmlog
npm install -g uid-number
npm install -g abbrev
npm install -g npm-registry-client
npm install -g chownr
npm install -g npm-cache-filename
npm install -g write-file-atomic
npm install -g char-spinner
npm install -g read-package-json
npm install -g npm-package-arg

Does NativeScript need to list these as dependencies?

Copied from original issue: NativeScript/NativeScript#1095

N3ll avatar Nov 13 '15 08:11 N3ll

Hi @arlowhite, I'm not sure what happened, but nativescript-cli does not depend on any of the packages that you've installed. Also in order to work correctly, nativescript-cli does not require global installation of any other package (-g flag). Do you have these dependencies listed in the package.json of your project for example?

rosen-vladimirov avatar Nov 13 '15 08:11 rosen-vladimirov

Fixed by reinstalling nativescript

tns version is 1.4.3

I'm going through the getting started guide. http://docs.nativescript.org/getting-started Followed the instructions in 1.1 Start your app (clone sample-Groceries, checkout start)

I removed the first module I had problems with to reproduce the error. npm uninstall -g child-process-close

I get this error with the create command as well:

awhite@ArloDesktop:~/Code/ng2/NativeScript$ tns create BlankApp Cannot find module 'child-process-close'

FIXED I just removed all the modules I installed globally and did a uninstall/install of nativescript, and now it works. Maybe there was an npm bug? I think I upgraded it since the first time I installed nativescript. Otherwise maybe my first install had an error I missed.

Sorry for the false-positive.

arlowhite avatar Nov 13 '15 17:11 arlowhite

@arlowhite , I'm not sure what caused the problem, but anyway I'm glad you were able to solve it :) I'm closing this thread, feel free to contact us in case you have any other problems :)

rosen-vladimirov avatar Nov 15 '15 19:11 rosen-vladimirov