Skip to content
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

TypeError: Cannot read property 'F_OK' of undefined #2341

Closed
DCGoD opened this issue May 24, 2017 · 10 comments
Closed

TypeError: Cannot read property 'F_OK' of undefined #2341

DCGoD opened this issue May 24, 2017 · 10 comments

Comments

@DCGoD
Copy link

DCGoD commented May 24, 2017

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Note: for build related issues you can open up an issue on the ionic-app-scripts repo

https://github.com/driftyco/ionic-app-scripts

Please ensure that you are on the latest version of the CLI.
npm view ionic@latest version

Short description of the problem:

Cannot execute command 'ionic' from an ionic3 project directory. Command works when outside of an ionic project dir.

What behavior are you expecting?

Error displays "TypeError: Cannot read property 'F_OK' of undefined"

Steps to reproduce:

  1. Run 'ionic' from any ionic3 project
insert any relevant code between the above and below backticks

Post the output of ionic info below please
[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

@ionic/cli-utils : 1.2.0
Ionic CLI        : 3.2.0

System:

Node       : v6.2.2
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002 
ios-deploy : 1.9.1 
ios-sim    : 5.0.4

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

@Oliviercreativ
Copy link

Oliviercreativ commented May 24, 2017

Hello I have the same problem and I do not know how to do to solve it.

Ionic info:
[WARN] You are not in an Ionic project directory. Project context may be missing.

Global packages:

     @ Ionic / cli-utils: 1.2.0
     Ionic CLI: 3.2.0

System:

     Node: v6.1.0
     OS: macOS Sierra
     Xcode: Xcode 8.3.2 Build version 8E2002
     Ios-deploy: not installed
     Ios-sim: 5.0.8

✘ olivier@olivier-2 $ ~/Sites/player/myApp ionic
TypeError: Cannot read property 'F_OK' of undefined

Thanks in advance for the help !

@Petzall
Copy link

Petzall commented May 24, 2017

Had the exact same issue but updating nodejs itself to LTS version 6.10.3 with NPM version 3.10.10 seemed to solve the problem.
Does it for you guys too maybe?

@Oliviercreativ
Copy link

Oliviercreativ commented May 24, 2017 via email

@TwixD
Copy link

TwixD commented May 24, 2017

Ty @Petzall updated node v7.10.0 and works!

@Petzall
Copy link

Petzall commented May 24, 2017

@Oliviercreativ the latest version of node is v7.10.0 like TwixD got, but the LTS (Long Term Support) version could be more stable.

If you're on MacOS or Windows the simplest way to upgrade is via nodejs.org, download the install package and run the installer!

@Oliviercreativ
Copy link

Work for me 👍 but i'm rebuilded node-sass !
Thx you ;)

@imhoffd
Copy link
Contributor

imhoffd commented May 24, 2017

Hey all, yep, the recommendations to upgrade node and npm are correct. You might only get this error if your node version is old (in this case, 6.1 and 6.2 are from mid-2016). In these days, even a year is an eternity for JS 😄

@DCGoD DCGoD closed this as completed May 25, 2017
@DCGoD
Copy link
Author

DCGoD commented May 25, 2017

FYI, nvm was holding back my currently installed v7.10.0 so this was just a mistake on my part not realizing the current running version of node was out of date. Thanks for catching that!

imhoffd added a commit that referenced this issue May 25, 2017
Instead of erroring with some strange message (const is not a thing,
fs.constants is undefined, etc) this will error out with a helpful
message.

Addresses #2341
Addresses #2107
@sameera207
Copy link

sameera207 commented May 26, 2017

I had the same issue, upgrading my node from v6.1.0 to v7.10.0 fixed it 😄

brew update
brew upgrade node
npm install -g npm

Check this SO answer on how to upgrade

I'm on

OS X EL Capital 10.11.6

@imhoffd
Copy link
Contributor

imhoffd commented May 26, 2017

Yep, latest 6 or 7 works.

ricmello pushed a commit to ricmello/ionic-cli that referenced this issue May 31, 2017
Instead of erroring with some strange message (const is not a thing,
fs.constants is undefined, etc) this will error out with a helpful
message.

Addresses ionic-team#2341
Addresses ionic-team#2107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants