Skip to content

Error when trying to use any ng functions (like ng new X for example) #2216

Closed

Description

@vladiRoz

Please provide us with the following information:

Mac OSX El Capitan.
node --version
v4.5.0
npm --version
2.15.9

I installed angular cli globally and I received this error, its happening with all ng functions, I cannot create a new project using ng.
please help.

ng --version / ng new PROG
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

TypeError: path must be a string
at TypeError (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Function.Version.fromProject (/usr/local/lib/node_modules/angular-cli/upgrade/version.js:87:31)
at Function.Version.isPreWebpack (/usr/local/lib/node_modules/angular-cli/upgrade/version.js:111:31)
at Function.Version.assertPostWebpackVersion (/usr/local/lib/node_modules/angular-cli/upgrade/version.js:97:18)
at /usr/local/lib/node_modules/angular-cli/bin/ng:25:15
at /usr/local/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:44:21
at ondir (/usr/local/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:187:31)
at /usr/local/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:153:39

Activity

  1. bohms27 commented on Sep 19, 2016

    @bohms27

    Having same issue

  2. bohms27 commented on Sep 19, 2016

    @bohms27

    Do you also have it installed locally? I had it installed globally and locally and received the error. Uninstalled the local version in the folder and it worked fine.

  3. vladiRoz commented on Sep 19, 2016

    @vladiRoz
    Author

    I created a new folder and tried to sudo ng new PROG....
    do you create a package.json? before the new?

  4. bohms27 commented on Sep 19, 2016

    @bohms27

    Nope I didn't have it created before

    On Sep 19, 2016 8:02 AM, "Vladi Rozen" notifications@github.com wrote:

    I created a new folder and tried to sudo ng new PROG....
    do you create a package.json? before the new?

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub
    #2216 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AF1R1VogUCtFqloFeTVwx9kf1R5zfMWfks5qrnnhgaJpZM4KAVeY
    .

  5. filipesilva commented on Sep 22, 2016

    @filipesilva
    Contributor

    See https://github.com/angular/angular-cli#prerequisites

    You need at least npm3 to run the CLI. I suggest installing Node 6 which comes with npm 3.

  6. adesugbaa commented on Sep 22, 2016

    @adesugbaa

    I have npm3 and node 5/6. It gives the same errors above.

  7. vladiRoz commented on Sep 22, 2016

    @vladiRoz
    Author

    I installed the prerequisites, latests npm and node (tried with all available versions).

  8. tamdao commented on Sep 22, 2016

    @tamdao

    I have npm 3.x and node 6.x. But I have the same issue

  9. jsight commented on Sep 22, 2016

    @jsight

    @filipesilva - I have npm 3.10.8 and have the same issue. Maybe this project just doesn't work on Node 4.5?

  10. sebge23 commented on Sep 23, 2016

    @sebge23
  11. jsight commented on Sep 27, 2016

    @jsight

    Workaround: #2355

  12. vadost commented on Oct 4, 2016

    @vadost

    Simplest workaround to continue working in your project is comment line 25 of node_modules/angular-cli/bin/ng :
    // Version.assertPostWebpackVersion();
    Until it is fixed properly.

  13. filipesilva commented on Oct 9, 2016

    @filipesilva
    Contributor

    Really fixed in #2178

  14. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  15. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions