Core: ./ace - No such file or directory

Created on 14 Apr 2016  Â·  33Comments  Â·  Source: adonisjs/core

I created a fresh droplet on Digital Ocean (The Node one click app) and followed the starting piece in the documentation to create yardstick.

When i try and use Ace i get:

adonis@adonis:~/yardstick$ ./ace
/usr/bin/env: node --harmony_proxies: No such file or directory

which node gives me /usr/bin/node

Most helpful comment

Ok i found hack for Linux... http://sambal.org/2014/02/passing-options-node-shebang-line/
It should be:

#!/bin/sh 
":" //# comment; exec /usr/bin/env node --harmony_proxies "$0" "$@"

'use strict'
/*
|--------------------------------------------------------------------------
|   Running Console Commands
|--------------------------------------------------------------------------
|
|  Here we invoke console commands registered under Ace store.
|
*/
const kernel = require('./bootstrap/kernel')
kernel()

It works for me, can anyone test it on OSX?

All 33 comments

Node version 4.4.3 btw

Are you using nvm or just clean node install from apt? As I can see, without nvm.

@dan-gamble Make use of node --harmony_proxies ace and your command.

It is a combination of several issues, i will be writing a blog post + a command to fix ace file.

I tried both global node & nvm.

That worked @thetutlage! I'll just set up an alias to use in the interim :)

Sure, the problem is --harmony flag does not work when using /usr/bin/env node. It needs to be /usr/bin/node.

Since the installation of NodeJs is different from every OS and also depends upon the way you have installed NodeJs.

I will add a command to adonis-cli to fix the ace file with the correct location of node on the current OS.

Awesome, thanks for the help :)

Hi Guys, I ran adonis fix and the issue was not fixed for me. I am using antergos. Any idea?

It can't work ...

http://stackoverflow.com/questions/8108917/why-does-passing-arguments-to-the-command-in-an-env-invocation-not-work

On Linux, the entire string following the interpreter name is passed as a single argument to the interpreter, and this string can include white space. [1] Thus, command line arguments are not split, and env command is trying to execute "node --harmony_proxies" file, which obviously could not be found

Ok i found hack for Linux... http://sambal.org/2014/02/passing-options-node-shebang-line/
It should be:

#!/bin/sh 
":" //# comment; exec /usr/bin/env node --harmony_proxies "$0" "$@"

'use strict'
/*
|--------------------------------------------------------------------------
|   Running Console Commands
|--------------------------------------------------------------------------
|
|  Here we invoke console commands registered under Ace store.
|
*/
const kernel = require('./bootstrap/kernel')
kernel()

It works for me, can anyone test it on OSX?

@vizo Kind of works great, have to test it on Windows too

Great!! @vizo it works :+1:

Hey guys, you also may use node ace make:[command] <params> ... from the Adonis project folder, and it does'n matter what OS you are using, just need NodeJS to run.

C:\Users\Admin\demowork>./ace
'.' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\ROHIT SAINI\ya>./ace
'.' is not recognized as an internal or external command,
operable program or batch file.

how to fix this problem ?

In windows env use
node --harmony-proxies ace migration:run

Like above

On Oct 22, 2016 6:44 PM, "rindia" [email protected] wrote:

C:\Users\Admin\demowork>./ace

'.' is not recognized as an internal or external command,

operable program or batch file.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/adonisjs/adonis-framework/issues/141#issuecomment-255527714,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC1M03xt2RgXL3-MJIhJU7KhoT9mvOwyks5q2gw8gaJpZM4IHwv0
.

added an alias like alias ace="node --harmony-proxies ./ace", so I just go ace make:model Cool in the app root and it works.

i have an issue when i tried to create a new project:

✔ Your current Node.js & npm version match the AdonisJs requirements!
✖ An error occured while trying to access "/Documents/WKS_SERVER/my_chat" directory
Cannot read property 'F_OK' of undefined

May you create a new issue in the adonis-cli repository and specify which OS you use (it looks like Windows) and which command do you run @raulvillca ?

@RomainLanz Fixed. Node.js v6.2 has fs.constants as undefined whereas v6.3 and later have fs.constants as defined. The weird part is versions earlier than v6.2 also has fs.constants defined.

Good to know! Thanks.

.ace is not working , please suggest me how to get rid of this issue

Dear @pushkertiwari !

What's your problem?

.ace make:controller home is not working , i have tried all the ways , but cli of adnois is not working in the terminal , always giving the isssue in the .ace is not found. @RomainLanz

You need to use ./ace and not .ace to use it inside your terminal.
You can also directly use it with node via node ace.

$ node ace make:controller XXX

thanks @RomainLanz , you have solved my problem.

@RomainLanz could you please help me in the autenication process of adnois js

@pushkertiwari Please join the gitter for those kind of questions

To run ace on Windows, create a file called ace.cmd in the root of your project with the following content

cd %~dp0
node ace %*

Now you can run ace make:view home (but NOT ./ace make:view home, so careful when following tutorials etc.)

There seem to be an issue when running during development. The server throw an event.js error while still serving, however the client is still connected to but the server still shows the error. I'm on a windows 10 machine.


From: DLUK44 notifications@github.com
Sent: 10 August 2017 19:05
To: adonisjs/adonis-framework
Cc: Subscribed
Subject: Re: [adonisjs/adonis-framework] ./ace - No such file or directory (#141)

To run ace on Windows, create a file called ace.cmd in the root of your project with the following content

cd %~dp0
node ace %*

Now you can run ace make:view home (but NOT ./ace make:view home, so careful when following tutorials etc.)

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/adonisjs/adonis-framework/issues/141#issuecomment-321629337, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVkQ5NGmyTRXDv8TfZDXr7n_ok20mLXFks5sW0aGgaJpZM4IHwv0.

Hey @DLUK44, @horiyomi !

First of all, thanks for the tips @DLUK44, we'll add that to the documentation for 4.0 if it's not already inside.

@horiyomi, may you create a new issue with the error you get?

@RomainLanz

In 4.0 adonis proxy all the project specific commands. So instead of running ace <cmd>, you can do adonis <cmd>, which fixes all cross platform issues

you should create a file named ace.js in the root with this code inside:

#!/usr/bin/env node

'use strict'
const kernel = require('./bootstrap/kernel')
kernel()

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

douglaszaltron picture douglaszaltron  Â·  3Comments

devcaststudio picture devcaststudio  Â·  3Comments

umaams picture umaams  Â·  3Comments

blendsoft picture blendsoft  Â·  3Comments

PC-HUB picture PC-HUB  Â·  4Comments