You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error when trying to use any ng functions (like ng new X for example) #2216
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
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.
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.
Activity
bohms27 commentedon Sep 19, 2016
Having same issue
bohms27 commentedon 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 commentedon Sep 19, 2016
I created a new folder and tried to sudo ng new PROG....
do you create a package.json? before the new?
bohms27 commentedon Sep 19, 2016
Nope I didn't have it created before
On Sep 19, 2016 8:02 AM, "Vladi Rozen" notifications@github.com wrote:
filipesilva commentedon Sep 22, 2016
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 commentedon Sep 22, 2016
I have npm3 and node 5/6. It gives the same errors above.
vladiRoz commentedon Sep 22, 2016
I installed the prerequisites, latests npm and node (tried with all available versions).
tamdao commentedon Sep 22, 2016
I have npm 3.x and node 6.x. But I have the same issue
jsight commentedon 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 commentedon 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 commentedon Sep 27, 2016
Workaround: #2355
vadost commentedon 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 commentedon Oct 9, 2016
Really fixed in #2178
angular-automatic-lock-bot commentedon Sep 6, 2019
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.