Apache cordova ,Unable to create an app - javascript

This is the output , knowing that i'm running it under a proxy , and i specified the proxy settings.
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
then i run this command to create a new app in the specified folder "hello".
C:\>cordova create hello com.example.hello HelloWorld
Creating a new cordova project with name "HelloWorld" and id "com.example.hello"
at location "C:\hello"
Downloading cordova library for www...
this is the error :
Error: connect ETIMEDOUT
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)

I recently had the same issue. I was maintaining an existing app and updating Cordova was well beyond the scope of the current task, so getting this working was really my only option.
Firstly, in order to eliminate all the errors and warnings about deprecated APIs when installing Cordova, I had to use some really ancient package managers. Using NVM I installed node 0.10.48 and npm 1.4.29. Cordova 3.6.3 then installed without any complaints.
But even creating an empty Cordova project wasn't possible as the below output shows:
Creating a new cordova project with name "HelloWorld" and id "com.example.hello" at location "~/Downloads"
Downloading cordova library for www...
Error: HTTP error 404 retrieving version 3.6.3 of cordova for www
at Request._callback (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/lazy_load.js:230:30)
at Request.self.callback (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:148:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:886:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:837:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:458:13)
Adding some extra debug output to lazy_load.js revealed that the CLI was looking for a directory at ~/.cordova/lib/www/cordova/3.6.3.
Since this was a brand new installation of Cordova, that directory obviously wasn't present so it went to download an archive from https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git;a=snapshot;h=3.6.3;sf=tgz but the archive that used to be there has apparently been removed. I found it at https://github.com/apache/cordova-app-hello-world/releases/tag/3.6.3.
I download that archive and extracted it to ~/.cordova/lib/www/cordova/3.6.3, and I was then able to create my template app.
I know this thread is old but I really hope this helps someone. Working with Cordova is a bitch at the best of times, let alone when vital online components are removed like this.

On OSX Yosemite even with sudo the error persists.

after digging a little bit more. i found the solution.
I have just run the cmd.exe as administrator. after that worked like magic.

I ran into this problem by not installing cordova as admin. I had to sudo npm install -g cordova to get the create command to work.

Related

How to fix "ENOTDIR" error when publishing to AWS Amplify

I am trying to push our latest code to our AWS Amplify project in the cloud. The other dev on our team does amplify publish and everything pushes to the cloud fine. When I do amplify publish it throws an ENOTDIR error. I feel like that means I am missing a dependency or a dependency got corrupted or something? I am at a loss.
I have tried doing amplify codegen, amplify env pull --restore, and I have tried removing and reading the #aws-amplify/cli package that I installed to my app directory with yarn when first installing everything for this web app. I know it's connected to the cloud properly because me and the other dev's amplify status output matches, as well as the amplify env get --name <environment name> command output.
The error I get every time I do amplify push is:
No changes detected
/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/gluegun/build/index.js:13
throw up;
^
Error: spawn ENOTDIR
at ChildProcess.spawn (internal/child_process.js:394:11)
at spawn (child_process.js:542:9)
at /usr/local/lib/node_modules/#aws-amplify/cli/node_modules/amplify-frontend-javascript/lib/builder.js:13:28
at new Promise (<anonymous>)
at Object.run (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/amplify-frontend-javascript/lib/builder.js:6:10)
at Object.run (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/amplify-frontend-javascript/lib/publisher.js:9:18)
at Object.publish (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/amplify-frontend-javascript/index.js:33:20)
at Command.run (/usr/local/lib/node_modules/#aws-amplify/cli/src/commands/publish.js:41:29)
at processTicksAndRejections (internal/process/task_queues.js:85:5) {
errno: 'ENOTDIR',
code: 'ENOTDIR',
syscall: 'spawn'
Thanks for any input on how to fix this! I am leery to try too much else on my own because I do not want to accidentally delete what is already in the cloud.

when i am trying to run mupx deploy it is showing error

error in console
shubhabrata#shubhabrata-VirtualBox:~/Meteor/myapp$ mupx deploy
Meteor Up: Production Quality Meteor Deployments
Configuration file : mup.json
Settings file : settings.json
“ Checkout Kadira!
It's the best way to monitor performance of your app.
Visit: https://kadira.io/mup ”
Meteor app path : /home/shubhabrata/Meteor/myapp
Using buildOptions : {}
buffer.js:80
throw new Error(
^
Error: If encoding is specified then the first argument must be a string
at new Buffer (buffer.js:80:13)
at Readable. (/usr/lib/node_modules/mupx/node_modules/archiver/lib/util/index.js:32:15)
at emitNone (events.js:91:20)
at Readable.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
Switching from node 7 to node 5.12 worked for me. I installed using nvm so that I can use later node versions in the future.
This occurred for me while using (deliberately) an old version of mup. It could well be that just upgrading mup will fix the problem.

Meteor reset not working in vagrant

I'm trying to get meteor reset to work in vagrant box. However I kept getting errors. This is my error message:
/home/vagrant/.meteor/packages/meteor-tool/.1.1.10.8ogiso++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278
throw(ex);
^ Error: EBUSY, rmdir '/vagrant/foosboom-meteor/.meteor/local'
at Object.Future.wait (/home/vagrant/.meteor/packages/meteor-tool/.1.1.10.8ogiso++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15)
at Object.rm_recursive (/tools/fs/files.js:270:9)
at Command.main.registerCommand.name [as func] (/tools/cli/commands.js:1211:9)
at /tools/cli/main.js:1378:23
I'm using hashicorp Otto as my development environment.
I have performed a mount on the local folder as suggested by one of the user here.
Any idea what seems to be the problem? Thanks.
After mounting you can't reset your mongo so do this
sudo umount -f /vagrant/foosboom-meteor/.meteor/local

Meteor run ios --verbose

when i try to run meteor todos example app in ios, by command
sudo meteor run ios --verbose
(The reason i use sudo because without sudo, it displays eaccess error, permission denied error)
Then after using above command with sudo i get following error:
** BUILD SUCCEEDED **
2014-12-10 17:55:17.475 ios-sim[4120:60148] stderrPath: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/console.log
2014-12-10 17:55:17.476 ios-sim[4120:60148] stdoutPath: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7ffcbb4103c0 {NSLocalizedDescription=Simulator session timed out.}
Command finished with error code 1: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/run --emulator
Error: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/Users/black_monk/.meteor/packages/meteor-tool/.1.0.36.690ab6++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
Could not start the app in the iOS simulator.
Try running again with the --verbose option.
It only display this message i am not sure what is the problem. I'm trying to get meteor run on mobile but one way or another it only fails, and im not sure why. I tried same on android, same EACCESS error.
All the SDKs are installed. No guide to learn from to clue whatsoever.
Please help.
You shouldn't need to use sudo to run anything in meteor. If you do, it sounds like you ran the meteor install command as sudo? If that is the case, try uninstalling meteor and reinstalling it as your normal user. It looks like you are encountering a permission error between meteor, cordova and the IOS simulator.
Did it,
changed all the directories to permission 777
sudo find /Users/black_monk/meteor_examples/todos/.meteor/local/ -type d -exec chmod 777 {} \;
and all the files inside it to 777 as well
sudo find /Users/black_monk/meteor_examples/todos/.meteor/local/ -type f -exec chmod 777 {} \;

TheIntern Dojo example exits with timeout error

The Example of Dojo tests run under Intern (https://github.com/theintern/intern-examples/tree/master/dojo-example) does not actually test anything, fails on connect to the Sauce network:
$ npm test
> dojo-intern-example#0.1.0 test /home/bogdanbiv/WebstormProjects/intern-examples/dojo-example
> intern-runner config=tests/intern
Listening on 0.0.0.0:9001
Starting tunnel...
Using no proxy for connecting to Sauce Labs REST API.
**********************************************************
A newer version of Sauce Connect (build 1283) is available!
Download it here:
https://saucelabs.com/downloads/sc-4.3-linux.tar.gz
**********************************************************
Started scproxy on port 49172.
Starting secure remote tunnel VM...
Secure remote tunnel VM provisioned.
Tunnel ID: 2f904e21cf1e4c3e83f63a4b3089127c
Secure remote tunnel VM is now: booting
Secure remote tunnel VM is now: running
Remote tunnel host is: maki76020.miso.saucelabs.com
Using no proxy for connecting to tunnel VM.
Establishing secure TLS connection to tunnel...
Cleaning up.
Finished! Deleting tunnel.
Error: failed to connect to tunnel VM.
Error: failed to connect to tunnel VM.
at reject <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:353:17>
at readStartupMessage <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:381:12>
at <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:434:12>
at Array.some <native>
at Socket.<anonymous> <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:428:21>
at Socket.EventEmitter.emit <events.js:117:20>
at Socket.<anonymous> <_stream_readable.js:746:14>
at Socket.EventEmitter.emit <events.js:92:17>
at emitReadable_ <_stream_readable.js:408:10>
at emitReadable <_stream_readable.js:404:5>
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
Ok it does complain about having an old Sauce Connect binary, but even after downloading and inserting the path of the newest SC (4.3). I also updated .bin/intern-runner to contain js as a running environment as opposed to the old node command. User and password are the ones from the repository (left them unchanged). I followed the documentation and did uncomment the tunnel in the intern config file.
UPDATE: This problem still occurs. I find it wierd that a proxy is started Started scproxy on port 54687., but, further down, Using no proxy for connecting to tunnel VM.. Aren't these lines supposed to match?
It could be that this mismatch has nothing to do with the original problem? The new Sauce Connect binary is still ignored.
UPDATE: Actually this solution affects only client, local - intern-client config=tests/intern. As a result this solution solves a different problem than the one originally posted. /UPDATE
The problem was that although I executed bower install as documented, the bower components installed in a folder set by the bowerrc global configuration. This was quite different from what the Dojo TodoMVC example required for its components.
Also submitted an issue at https://github.com/theintern/intern-examples/issues/10 and a pull request.

Categories

Resources