Skip to content

npm install infinite build #297

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
Zatchou opened this issue Mar 11, 2015 · 32 comments
Closed

npm install infinite build #297

Zatchou opened this issue Mar 11, 2015 · 32 comments
Assignees
Labels
Milestone

Comments

@Zatchou
Copy link

Zatchou commented Mar 11, 2015

Hi,

I'm trying to install nativescript but each time (whatever the nodejs version) it fails because i never pass this line (even after 20min..). I currently use nodejs 0.10.36.

"
npm WARN deprecated [email protected]: critical bug fixed in v4.2.0
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css
npm WARN excluding symbolic link docs\assets\ir_black.css -> ../../node_modules/
highlight.js/src/styles/ir_black.css
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css
|

[email protected] install C:\Users\Test\AppData\Roaming\npm\node_modules\native
script\node_modules\fibers
node ./build.js " <---- ...

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch ,

This is really strange. I assume you are working on Windows, am I right? Could you try executing
$npm install nativescript --verbose and send the output? Are you using 32-bit or 64-bit node?

@Zatchou
Copy link
Author

Zatchou commented Mar 11, 2015

Yes you are right, windows. Node 64-bit.

This is a part of last ouputs :

npm verb tar unpack C:\Users\KNSD1821\AppData\Roaming\npm-cache\debug\2.1.2\pack
age.tgz
npm verb lock tar://C:\Users\KNSD1821\myApp\node_modules\nativescript\node_modul
es\ref-struct\node_modules\debug C:\Users\KNSD1821\AppData\Roaming\npm-cache\2a7
b36c2-es-ref-struct-node-modules-debug.lock
npm verb lock tar://C:\Users\KNSD1821\AppData\Roaming\npm-cache\debug\2.1.2\pack
age.tgz C:\Users\KNSD1821\AppData\Roaming\npm-cache\fe2edf10-pm-cache-debug-2-1-
2-package-tgz.lock
npm info preinstall [email protected]
npm info preinstall [email protected]
npm info preinstall [email protected]
npm info preinstall [email protected]
npm info preinstall [email protected]
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb readDependencies using package.json deps
npm verb about to build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_m
odules\log4js\node_modules\semver
npm info build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_modules\lo
g4js\node_modules\semver
npm verb linkStuff [ false,
npm verb linkStuff false,
npm verb linkStuff false,
npm verb linkStuff 'C:\Users\KNSD1821\myApp\node_modules\nativescript\no
de_modules\log4js\node_modules' ]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb link bins [ { semver: './bin/semver' },
npm verb link bins 'C:\Users\KNSD1821\myApp\node_modules\nativescript\no
de_modules\log4js\node_modules.bin',
npm verb link bins false ]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb readDependencies using package.json deps
npm verb about to build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_m
odules\log4js\node_modules\async
npm info build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_modules\lo
g4js\node_modules\async
npm verb linkStuff [ false,
npm verb linkStuff false,
npm verb linkStuff false,
npm verb linkStuff 'C:\Users\KNSD1821\myApp\node_modules\nativescript\no
de_modules\log4js\node_modules' ]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb readDependencies using package.json deps
npm verb about to build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_m
odules\unzip\node_modules\match-stream\node_modules\buffers
npm info build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_modules\un
zip\node_modules\match-stream\node_modules\buffers
npm verb linkStuff [ false,
npm verb linkStuff false,
npm verb linkStuff false,
npm verb linkStuff 'C:\Users\KNSD1821\myApp\node_modules\nativescript\no
de_modules\unzip\node_modules\match-stream\node_modules' ]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb readDependencies using package.json deps
npm verb about to build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_m
odules\fibers
npm info build C:\Users\KNSD1821\myApp\node_modules\nativescript\node_modules\fi
bers
npm verb linkStuff [ false,
npm verb linkStuff false,
npm verb linkStuff false,
npm verb linkStuff 'C:\Users\KNSD1821\myApp\node_modules\nativescript\no
de_modules' ]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm info install [email protected]
npm info install [email protected]
npm verb cache add [ '[email protected]', null ]
npm verb cache add name=undefined spec="[email protected]" args=["[email protected]",null]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '[email protected]',
npm verb parsed url path: '[email protected]',
npm verb parsed url href: '[email protected]' }
npm verb cache add [ '[email protected]', null ]
npm verb cache add name=undefined spec="[email protected]" args=["[email protected]",null]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '[email protected]',
npm verb parsed url path: '[email protected]',
npm verb parsed url href: '[email protected]' }
npm verb cache add [ '[email protected]', null ]
npm verb cache add name=undefined spec="[email protected]" args=["[email protected]",null]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '[email protected]',
npm verb parsed url path: '[email protected]',
npm verb parsed url href: '[email protected]' }
npm verb cache add [ '[email protected]', null ]
npm verb cache add name=undefined spec="[email protected]" args=["[email protected]",nul
l]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '[email protected]',
npm verb parsed url path: '[email protected]',
npm verb parsed url href: '[email protected]' }
npm verb cache add [ '[email protected]', null ]
npm verb cache add name=undefined spec="[email protected]" args=["[email protected]",nul
l]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '[email protected]',
npm verb parsed url path: '[email protected]',
npm verb parsed url href: '[email protected]' }
npm verb cache add [ '[email protected]', null ]
npm verb cache add name=undefined spec="[email protected]" args=["stack-trace@0.
0.x",null]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '[email protected]',
npm verb parsed url path: '[email protected]',
npm verb parsed url href: '[email protected]' }
npm info install [email protected]
npm verb cache add name="async" spec="0.1.x" args=["async","0.1.x"]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '0.1.x',
npm verb parsed url path: '0.1.x',
npm verb parsed url href: '0.1.x' }
npm verb addNamed [ 'async', '0.1.x' ]
npm verb addNamed [ null, '>=0.1.0-0 <0.2.0-0' ]
npm verb lock [email protected] C:\Users\KNSD1821\AppData\Roaming\npm-cache\463e1c03-a
sync-0-1-x.lock
npm verb cache add name="cycle" spec="1.0.x" args=["cycle","1.0.x"]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '1.0.x',
npm verb parsed url path: '1.0.x',
npm verb parsed url href: '1.0.x' }
npm verb addNamed [ 'cycle', '1.0.x' ]
npm verb addNamed [ null, '>=1.0.0-0 <1.1.0-0' ]
npm verb lock [email protected] C:\Users\KNSD1821\AppData\Roaming\npm-cache\dfb63733-c
ycle-1-0-x.lock
npm verb cache add name="eyes" spec="0.1.x" args=["eyes","0.1.x"]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '0.1.x',
npm verb parsed url path: '0.1.x',
npm verb parsed url href: '0.1.x' }
npm verb addNamed [ 'eyes', '0.1.x' ]
npm verb addNamed [ null, '>=0.1.0-0 <0.2.0-0' ]
npm verb lock [email protected] C:\Users\KNSD1821\AppData\Roaming\npm-cache\81039dce-ey
es-0-1-x.lock
npm verb cache add name="pkginfo" spec="0.2.x" args=["pkginfo","0.2.x"]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '0.2.x',
npm verb parsed url path: '0.2.x',
npm verb parsed url href: '0.2.x' }
npm verb addNamed [ 'pkginfo', '0.2.x' ]
npm verb addNamed [ null, '>=0.2.0-0 <0.3.0-0' ]
npm verb lock [email protected] C:\Users\KNSD1821\AppData\Roaming\npm-cache\f898f07d
-pkginfo-0-2-x.lock
npm verb cache add name="request" spec="2.9.x" args=["request","2.9.x"]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '2.9.x',
npm verb parsed url path: '2.9.x',
npm verb parsed url href: '2.9.x' }
npm verb addNamed [ 'request', '2.9.x' ]
npm verb addNamed [ null, '>=2.9.0-0 <2.10.0-0' ]
npm verb lock [email protected] C:\Users\KNSD1821\AppData\Roaming\npm-cache\0258777d
-request-2-9-x.lock
npm verb cache add name="stack-trace" spec="0.0.x" args=["stack-trace","0.0.x"]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: '0.0.x',
npm verb parsed url path: '0.0.x',
npm verb parsed url href: '0.0.x' }
npm verb addNamed [ 'stack-trace', '0.0.x' ]
npm verb addNamed [ null, '>=0.0.0-0 <0.1.0-0' ]
npm verb lock [email protected] C:\Users\KNSD1821\AppData\Roaming\npm-cache\00b1
025d-stack-trace-0-0-x.lock

[email protected] install C:\Users\KNSD1821\myApp\node_modules\nativescript\node_mo
dules\fibers
node ./build.js

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch
I've checked this script and tried installing nativescript-cli on my Windows 8 machine and everything worked fine. The only idea I have is to try executing fiber's build script manually and see what's going on. Just go to C:\Users\KNSD1821\myApp\node_modules\nativescript\node_mo
dules\fibers and execute on your console node ./build.js
If it stays this way for a long time, you can try opening build.js and place some console.log("smth") on several places in it and execute it again. This way we'll get more information on which step the execution is taking a lot of time (or failing silently).

@Zatchou
Copy link
Author

Zatchou commented Mar 11, 2015

Bingo.

"
C:\Users\KNSD1821\myApp>node C:\Users\KNSD1821\myApp\node_modules\nativescript\n
ode_modules\fibers\build.js
//---BEGIN---//
//---BEFORE PARSE ARGS---//
//---BEFORE TEST PRE-BUILD---//
win32-x64-v8-3.14 exists; testing
//---BEFORE BUILD()---//
//---BEFORE AFTER_BUILD()---//
//---END---//
Problem with the binary; manual build incoming "

...and the script freeze.

@rosen-vladimirov
Copy link
Contributor

Hm, this is really strange. We've prebuilt node-fibers and the binary win32-x64-v8-3.14 is fine on our side. I have some ideas, that could help.
First of all, can you try removing your npm-cache (it should be under: C:\Users\KNSD1821\AppData\Roaming\npm-cache) and try installing nativescript again.
If this doesn't help, can you try installing only fibers in any folder, just execute:
npm i https://github.com/icenium/node-fibers/tarball/v1.0.5.1
After that, you should see node_modules directory on the place where you've installed the fibers, navigate to it and try executing node build.js from this directory. nativescript-cli installs fibers in the same way.

If this fails again, could you try installing 32-bit version of nodejs and see if it will work for you.

Also it will be great if you can send the output of node --version and npm --version

Thank you very much for your cooperation. I'm looking forward to hearing from you.

@Zatchou
Copy link
Author

Zatchou commented Mar 11, 2015

Cache cleaned doesn't change
but i installed only fibers, and the build.js works :
"
C:\Users\KNSD1821\node_modules\fibers>node build.js
win32-x64-v8-3.14 exists; testing
Binary is fine; exiting "

Should I replace the folder, then ?

Thanks you (!) for your assistance.

@rosen-vladimirov
Copy link
Contributor

I'm not sure how you would replace it and use it in nativescript-cli installation. You can try the following:

npm cache clean
npm uninstall -g nativescript
npm install -g nativescript

If the installation fails, you can try replacing fibers folder inside nativescript's node_modules directory. After that, in nativescript's root folder execute npm install. This will take all dependencies from package.json and install them in node_modules. If they are already there, I assume they will not be replaced.

Hope this will make it. As we would like to find out the cause of the issue, could you share your npm version: the output of npm --version should be enough.

@Zatchou
Copy link
Author

Zatchou commented Mar 11, 2015

It doesn't work. My npm version : 1.4.28

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch , I've just found some links related to similar problem with 1.x version of npm. I've also discussed the issue with some of my colleagues and they've mentioned that they've seen such issue (not exactly with fibers installation, but with other node modules). The solution in most of the cases is to update npm. The easiest way here is to try another node version. Could you install nodejs 0.12.0 and try installing nativescript again. I'm looking forward to hearing from you.

@Zatchou
Copy link
Author

Zatchou commented Mar 12, 2015

Hi @rosen-vladimirov, Sorry i had to go yesterday.

If i downgraded my nodejs version to 0.10.X it's because i thought it was recommanded. The second reason : i have a failure after tns create tnstest :

C:\Users\KNSD1821>tns create tnstest
Failed to retrieve data from npm. Please try again a little bit later.. Error: E
rror: connect ECONNREFUSED

Is it a proxy problem ? I don't think so, i already set proxy variable which works with everything.

BTW, my outputs after a npm i -g nativescript with nodejs v.0.12.0 :

C:\Users\KNSD1821>npm i -g nativescript
npm WARN deprecated [email protected]: critical bug fixed in v4.2.0
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css
npm WARN excluding symbolic link docs\assets\ir_black.css -> ../../node_modules/
highlight.js/src/styles/ir_black.css
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {
"node":"0.12.0","npm":"2.5.1"})

[email protected] install C:\Users\KNSD1821\AppData\Roaming\npm\node_modules\native
script\node_modules\fibers
node ./build.js

win32-x64-v8-3.28 exists; testing
Binary is fine; exiting
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css
npm WARN excluding symbolic link examples\TestFramework\Test Framework.framework
\Resources -> Versions/Current/Resources
npm WARN excluding symbolic link examples\TestFramework\Test Framework.framework
\Test Framework -> Versions/Current/Test Framework
npm WARN excluding symbolic link examples\TestFramework\Test Framework.framework
\Versions\Current -> A

[email protected] install C:\Users\KNSD1821\AppData\Roaming\npm\node_modules\nativescr
ipt\node_modules\ref
node ./build.js

win32-x64-v8-3.28 exists; testing
Binary is fine; exiting
npm WARN excluding symbolic link docs\assets\ir_black.css -> ../../node_modules/
highlight.js/src/styles/ir_black.css
npm WARN excluding symbolic link examples\TestFramework\Test Framework.framework
\Resources -> Versions/Current/Resources
npm WARN excluding symbolic link examples\TestFramework\Test Framework.framework
\Test Framework -> Versions/Current/Test Framework
npm WARN excluding symbolic link examples\TestFramework\Test Framework.framework
\Versions\Current -> A
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css

[email protected] install C:\Users\KNSD1821\AppData\Roaming\npm\node_modules\nativescr
ipt\node_modules\node-inspector\node_modules\ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

C:\Users\KNSD1821\AppData\Roaming\npm\node_modules\nativescript\node_modules\nod
e-inspector\node_modules\ws>node "C:\Program Files\nodejs\node_modules\npm\bin\n
ode-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
npm WARN excluding symbolic link docs\stylesheets\hightlight.css -> ../../node_m
odules/highlight.js/src/styles/solarized_light.css

[email protected] install C:\Users\KNSD1821\AppData\Roaming\npm\node_modules\nativescr
ipt\node_modules\ffi
node ./build.js

win32-x64-v8-3.28 exists; testing
Binary is fine; exiting
C:\Users\KNSD1821\AppData\Roaming\npm\tns -> C:\Users\KNSD1821\AppData\Roaming\n
pm\node_modules\nativescript\bin\nativescript.js
C:\Users\KNSD1821\AppData\Roaming\npm\nativescript -> C:\Users\KNSD1821\AppData
Roaming\npm\node_modules\nativescript\bin\nativescript.js

[email protected] postinstall C:\Users\KNSD1821\AppData\Roaming\npm\node_modu
les\nativescript
node postinstall.js

stdout: Restart your shell to enable command auto-completion.

[email protected] C:\Users\KNSD1821\AppData\Roaming\npm\node_modules\nativescri
pt
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], through2@0.
2.3)
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], m
[email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], wi
[email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected],
[email protected])
├── [email protected] ([email protected], [email protected], [email protected], xmlbuilde
[email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], s
[email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] "

Don't know if it can be useful.

EDIT : I tried last night to create a project on an other windows 8.1 with nodejs 0.12.0 and it works.. so the problem is probably this computer.

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch
Thanks for sending the log. It indicates that the installation is correct this time. The problem with create command is different, but I believe it is caused by the same reason - it looks like there are some limitations on your machine when connecting to npm and sometimes you are unable to install the packages or they are not fully downloaded. When you create new project, we execute npm install tns-template-hello-world and this is the operation that's failing. As you've seen, the error is ECONNREFUSED, which is nodejs's error for unable to connect. Also npmjs is not the most stable one, so sometimes you'll see this error and the solution is really to try again in 2-3 minutes. Have you tried? If this doesn't help, can you try npm install tns-template-hello-world? If it passes, you can try
tns create test1 --copy-from <path to installation dir of tns-template-hello-world>

@Zatchou
Copy link
Author

Zatchou commented Mar 12, 2015

That's ok. But then, I tried tns platform add android and got :

Copying template files... Failed to retrieve data from npm. Please try again a little bit later.. Error: E rror: connect ECONNREFUSED

It seems that, this problem will always block me somewhere, whatever if i downoald directly the android platform.

@rosen-vladimirov
Copy link
Contributor

I've checked our code and before installing the required package from npm, we make http call to http://registry.npmjs.org/ to check the latest version of the package. I assume these calls are failing on your side (as npm install outside of nativescript-cli is working for you). Can you try opening http://registry.npmjs.org/tns-android from your browser and see if you receive result (it should be JSON). Maybe there's a problem with your ironport or machine configuration for accessing registry.npmjs.org

@Zatchou
Copy link
Author

Zatchou commented Mar 12, 2015

No problems. Page full of json.

@Zatchou
Copy link
Author

Zatchou commented Mar 12, 2015

Is it possible that nativescript or npm would have some difficulties when using a corporate's proxy ?
It's weird...

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch, well npm should be configured in order to work correctly when a corporate proxy is in use. Please take a look at this blog post Can you try the commands mentioned there and see if it will work for you?

@Zatchou
Copy link
Author

Zatchou commented Mar 12, 2015

That's exactly the website i consulted to param npm.. Actually I've no more ideas to solve the problem.

@rosen-vladimirov rosen-vladimirov added this to the 0.9.2 milestone Mar 13, 2015
@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch
May I ask you one last thing (once again, thank you very much for your cooperation). Can you try installing this custom package of nativescript-cli. Just download the file and execute:
$ npm i nativescript-0.9.1.tgz -g
After the installation finishes, find the place where nativescript is installed and open <nativescript-cli-dir>\lib\config.js and modify FIDDLER_HOSTNAME to match your proxy.
After that can you try creating new project and adding platforms, so we'll see if this works. We are working on adding support for proxy, but we'll be really greatful if you can test this approach on your side and inform us if it works.
One more thing, the package I've shared is created from this branch, so you can compare it with our latest release branch to see my changes - they are only in the config file.

@Zatchou
Copy link
Author

Zatchou commented Mar 13, 2015

Ok I understand now. When i just try do download this custom package, i have a ERR_CONNECTION_REFUSED.
If you use dropbox as cloud, i can't make any download because my corporate block this website. So the problem comes from here ! :)

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch
No, we do not use dropbox for backend. I've used it just to upload this package in my own dropbox. I'll try to upload it on another place, so you can take the package and try it on your side.

@rosen-vladimirov
Copy link
Contributor

Can you try this link - it is from github repo, so it should work this time.

rosen-vladimirov added a commit to telerik/mobile-cli-lib that referenced this issue Mar 13, 2015
Rename the following config options:
 - FIDDLER_HOSTNAME to PROXY_HOSTNAME
 - PROXY_TO_FIDDLER to USE_PROXY

Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs.

Required for NativeScript/nativescript-cli#297 and NativeScript/nativescript-cli#302
rosen-vladimirov added a commit that referenced this issue Mar 13, 2015
Add config.json file inside new config directory. This file is required in order to allow user specific configurations. Modify nativescript-cli.ts in order to wrap resolving of config and errors inside fiber as the new implementation of config has .wait().

Update common lib, where the following changes are applied:
Rename the following config options:
 - FIDDLER_HOSTNAME to PROXY_HOSTNAME
 - PROXY_TO_FIDDLER to USE_PROXY

Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs.

Required for #297 and #302
rosen-vladimirov added a commit that referenced this issue Mar 13, 2015
Add config.json file inside new config directory. This file is required in order to allow user specific configurations. Modify nativescript-cli.ts in order to wrap resolving of config and errors inside fiber as the new implementation of config has .wait().

Update common lib, where the following changes are applied:
Rename the following config options:
 - FIDDLER_HOSTNAME to PROXY_HOSTNAME
 - PROXY_TO_FIDDLER to USE_PROXY

Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs.

Required for #297 and #302
@Zatchou
Copy link
Author

Zatchou commented Mar 13, 2015

Something like that ? :

PROXY_TO_FIDDLER: true,
FIDDLER_HOSTNAME: 'my_proxy', (or 'http://my_proxy' ?)
PROXY_PORT: 80

It didn't work for me.

rosen-vladimirov added a commit that referenced this issue Mar 13, 2015
Add config.json file inside new config directory. This file is required in order to allow user specific configurations. Modify nativescript-cli.ts in order to wrap resolving of config and errors inside fiber as the new implementation of config has .wait().

Update common lib, where the following changes are applied:
Rename the following config options:
 - FIDDLER_HOSTNAME to PROXY_HOSTNAME
 - PROXY_TO_FIDDLER to USE_PROXY

Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs.

Required for #297 and #302
@rosen-vladimirov
Copy link
Contributor

@Kyozatch, the project I've sent you doesn't respect PROXY_PORT option. I've prepared another package, you can download it from here
After you install it, go to installation folder and find config file. In it you will find config.json file - fill in your details (PROXY_PORT, PROXY_HOSTNAME and set USE_PROXY to true) and try again.

Thank you very much!

@Zatchou
Copy link
Author

Zatchou commented Mar 13, 2015

Very great job, it works !!
I can create my project without any problem.

But now I meet a new kind of error when i want to add an android platform to my new project.

C:\Users\KNSD1821\projects\nstest>tns platform add android
Copying template files...
spawn cmd ENOENT

I'm still with nodejs 0.12.0. Should i downgrade to a 0.10.X ?

@rosen-vladimirov
Copy link
Contributor

Can you run your command once again by using --log trace:
$ tns platform add android --log trace
and send the output?

@rosen-vladimirov
Copy link
Contributor

And nativescript-cli should work fine with nodejs 0.12, so there's no need to downgrade your version :)

@Zatchou
Copy link
Author

Zatchou commented Mar 13, 2015

Here i am :

"C:\Users\KNSD1821\projects\nstest>tns platform add android --log trace
Starting watch on killswitch C:\Users\KNSD1821\AppData\Local\Temp\KNSD1821\KillS
witches\cli
AnalyticsInstallationID: de485939-95cf-448c-81d2-552c8d7a12a7
monitor not started
monitor not started
monitor has started, connecting to http://5752dabccfc54c4ab82aea9626b7338e.monit
or-eqatec.com/json.ashx
Looking for project in 'C:\Users\KNSD1821\projects\nstest'
Project directory is 'C:\Users\KNSD1821\projects\nstest'.
spawn: adb version
Exec ant -version
stdout: Apache Ant(TM) version 1.9.4 compiled on April 29 2014

stderr:
Creating NativeScript project for the android platform
Path: C:\Users\KNSD1821\projects\nstest\platforms\android
Package: org.nativescript.nstest
Name: nstest
Copying template files...
Using proxy with host: my_proxy, port: 80, path is: http://registry.npmjs.org/t
ns-android
User-Agent: AppBuilderCLI/0.9.1 (Node.js 0.12.0; win32; x64)
httpRequest: { method: 'GET',
host: 'my_proxy',
port: 80,
path: 'http://registry.npmjs.org/tns-android',
headers:
{ Host: 'registry.npmjs.org',
Accept: 'application/json; charset=UTF-8, /;q=0.8',
'User-Agent': 'AppBuilderCLI/0.9.1 (Node.js 0.12.0; win32; x64)',
'Accept-Encoding': 'gzip,deflate' } }
httpRequest: Sending:
[nothing]
Statistics failed to be sent: 503
httpRequest: Done. code = 200
Statistics failed to be sent: 503
Exec android list targets

stdout: Available Android targets:

id: 1 or "android-15"
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 5
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800

Tag/ABIs : default/armeabi-v7a, default/x86

id: 2 or "android-19"
Name: Android 4.4.2
Type: Platform
API level: 19
Revision: 4
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in

Tag/ABIs : default/armeabi-v7a, default/x86

id: 3 or "android-21"
Name: Android 5.0.1
Type: Platform
API level: 21
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in

Tag/ABIs : no ABIs.

id: 4 or "Google Inc.:Google APIs:15"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 4.0.3 (API level 15)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800

Tag/ABIs : default/armeabi-v7a

id: 5 or "Google Inc.:Google APIs:19"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 10
Description: Android + Google APIs
Based on Android 4.4.2 (API level 19)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in

Tag/ABIs : default/armeabi-v7a

id: 6 or "Google Inc.:Google APIs (x86 System Image):19"
Name: Google APIs (x86 System Image)
Type: Add-On
Vendor: Google Inc.
Revision: 10
Description: Android x86 + Google APIs
Based on Android 4.4.2 (API level 19)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in

Tag/ABIs : default/x86

id: 7 or "Google Inc.:Google APIs:21"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 5.0.1 (API level 21)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in
Tag/ABIs : google_apis/x86

stderr: 'xcopy' n'est pas reconnu en tant que commande interne
ou externe, un programme ex?cutable ou un fichier de commandes.

Android target: android-21
spawn: cmd /s /c android update project --path C:\Users\KNSD1821\projects\nstest
\platforms\android --target android-21 --name nstest
spawn cmd ENOENT "

Seems like "xcopy" is an unknow function. (french logs sorry :P )

@rosen-vladimirov
Copy link
Contributor

Can you try executing android command on your console, just write $ android
I suspect you do not have platform-tools and tools directories from Android SDK added to your PATH. Please note that this is one of our system requirement - check step 5. Installing Android SDK for correct setup.

@Zatchou
Copy link
Author

Zatchou commented Mar 13, 2015

You're right, $ android doesn't work, but my path looks correct.

PATH :
C:\Users\KNSD1821\AppData\Roaming\npm;%JAVA_HOME%\bin;C:\ProgramData\Oracle\Java\javapath;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%ANT_HOME%\bin;C:\Program Files\nodejs\

ANDROID_HOME :
C:\Users\KNSD1821\AppData\Local\Android\sdk

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch

We've checked this error - in android.bat file inside ANDROID_HOME\tools, there's a call to xcopy. It looks like for some reason you do not have xcopy. As this tool is part of Windows installation, I'm not sure how we can help you in this case. On my machine the xcopy is under C:\Windows\System32 directory. Also you can try executing $ echo %PATH% on your console and you'll see the correct resolved paths. See if C:\Windows\System32 is part of your path and if there's xcopy in the specified dir.

@Zatchou
Copy link
Author

Zatchou commented Mar 13, 2015

I don't know why, but my path to System32 has been delete. So now everything works good !
Thanks you so much for your assistance @rosen-vladimirov !!! You're a prince.
I look forward to start to code :)

@rosen-vladimirov
Copy link
Contributor

Hi @Kyozatch,
I'm glad we've finally succeeded. We wouldn't make it without your help. Hope you'll like NativeScript :)

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

No branches or pull requests

3 participants