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

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.

Related

zsh: command not found: sls

I am running a node js application with AWS.
This is server less application therefore when I am trying to install through this
https://www.serverless.com/plugins/serverless-offline
Things are working fine till here.. after that when I am trying to run sls offline I am getting this error.
zsh: command not found: sls
Can anybody help me what I am missing here. Also I have places all the access details of my AWS creads in AWS credentials.

Syntaxerror: Unexpected Token , in Hawk (fresh npn install)

I am in the process of learning Nodejs and WebRPC. I am for all intents and purposes, a novice.
I installed the Plivo (http://plivo.com) API for nodejs and when attempting to run it I had an issue with Const which I resolved by running my test file with --harmony appended to the start of the command, after this I have gained the error
Syntaxerror: Unexpected token ,
This error falls on line 506 of
\hawk\lib\server.js
The relevant section of code is;
const artifacts = {
ts: authorization.ts,
nonce: authorization.nonce,
host,
port,
hash: authorization.hash
};
line 506 is host,
I do not see the problem.
At this point, all I am trying to do is initialise the plivo API. I have no other calls to it.
I have deleted the hawk folder and done a fresh npm install hawk, can anyone else suggest anything?
edit:
As of writing the post, I attempted to load hawk directly in a script rather than as a dependency through plivo. It still brings up the same error so it won't be a problem with plivo.
Edit 2.
Seems it was a versioning issue. My system had v0.12 installed. I attempted to update it twice, both times the install went back to v0.12 despite uninstalling it first.
Cleared appdata\roaming\npm and appdata\roaming\npm-cache as well as deleting any remaining node files in "c:\program files" before reinstalling. I now have 8.x installed and the syntax error is no longer showing.
Thanks
Ken

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

Apache cordova ,Unable to create an app

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.

Dotcloud nodejs supervisord.conf not working

I've been trying to get my nodejs server process to be monitored by supervisor, however I'm having issues getting supervisord.conf to work. When I deploy, I get the following error:
WARNING: The service crashed at startup or is listening to the wrong port. It failed to respond on port "node" (42801) within 30 seconds. Please check the application logs.
However when I ssh into the dotcloud server and manually start the nodejs process, it runs just fine, indicating that supervisor is failing to start the node instance.
My supervisord.conf looks like this:
[program:node]
command = node /home/dotcloud/current/app/server.js
autostart=true
autorestart=true
And my directory structure is as follows:
.dotcloudignore
dotcloud.yml
.gitignore
app/
app/package.json
app/server.js
app/supervisord.conf
At this point, I can't see what I'm doing wrong, as this appears to be the same directory structure as outlined here, so I'm kind of at a loss as to what the solution is. Any ideas?
Edit:
After trying a supervisorctl status I get the following:
node FATAL Exited too quickly (process log may have details)
I've found that in /var/log/supervisor, I'm getting the following error message:
module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module '/home/dotcloud/current/app/server.js'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:38)
I'm not sure what is causing this.
After investigating the issue, it looks like the issue came from the fact that dotcloud.yml specified approot: app. In that case, it is useful to note that:
/home/dotcloud/code will point to the whole code repository;
/home/dotcloud/current will point to the approot (more specifically, /home/dotcloud/current will be a symlink to the approot, i.e. code/app in that case).
Therefore, supervisord.conf should not contain:
command = node /home/dotcloud/current/app/server.js
But, instead:
command = node /home/dotcloud/current/server.js
The key was in the Node.js logs themselves, since Node.js was complaining about being unable to locate /home/dotcloud/current/app/server.js.

Categories

Resources