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

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

Closed
vladiRoz opened this issue Sep 19, 2016 · 14 comments
Closed

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

vladiRoz opened this issue Sep 19, 2016 · 14 comments

Comments

@vladiRoz
Copy link

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

@bohms27
Copy link

bohms27 commented Sep 19, 2016

Having same issue

@bohms27
Copy link

bohms27 commented Sep 19, 2016

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.

@vladiRoz
Copy link
Author

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

@bohms27
Copy link

bohms27 commented Sep 19, 2016

Nope I didn't have it created before

On Sep 19, 2016 8:02 AM, "Vladi Rozen" [email protected] 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
.

@filipesilva
Copy link
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.

@adesugbaa
Copy link

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

@vladiRoz
Copy link
Author

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

@tamdao
Copy link

tamdao commented Sep 22, 2016

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

@jsight
Copy link

jsight commented Sep 22, 2016

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

@sebge23
Copy link

sebge23 commented Sep 23, 2016

I have the same issue and i found this question on stackoverflow.

http://stackoverflow.com/questions/39541930/error-while-creating-new-project-with-angular-cli#comment66616273_39541930

@jsight
Copy link

jsight commented Sep 27, 2016

Workaround: #2355

@vadost
Copy link

vadost commented Oct 4, 2016

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.

@filipesilva
Copy link
Contributor

Really fixed in #2178

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants