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
For some unknown reason, ng commands stopped working. A lot of other people on various OSs were having a similar problem. I uninstalled npm, uninstalled node, and deleted the global node_modules folder, and installed the latest version of everything and got ng commands working again. Search for a 'complete' uninstall of npm/node to find your global node_modules folder for your OS.
C:\Users\guido>npm -v
3.10.5
C:\Users\guido>node -v
v6.2.2
C:\Users\guido>ng -v
fs.js:634
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
TypeError: path must be a string or Buffer
at TypeError (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at Function.Version.fromProject (C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:87:31)
at Function.Version.isPreWebpack (C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:111:31)
at Function.Version.assertPostWebpackVersion (C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\upgrade\version.js:97:18)
at C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\bin\ng:25:15
at C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:44:21
at ondir (C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:187:31)
at C:\Users\guido\AppData\Roaming\npm\node_modules\angular-cli\node_modules\resolve\lib\async.js:153:39
Activity
guidoffm commentedon Oct 1, 2016
I get this error:
maartenpaauw commentedon Oct 1, 2016
Tried it multiple times. Still no success.
matt-erhart commentedon Oct 1, 2016
Hmmm, what I did worked for windows 10. I suspect the trick is to find all the files node/npm have placed around your OS to get a true clean slate.
filipesilva commentedon Oct 8, 2016
@matt-erhart that's my recommendation for when ng commands stop working overall. There might be a bunch of causes for it though... I tried to gather the common ones in https://github.com/angular/angular-cli/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3A%22type%3A%20faq%22%20 .
I appreciate you sharing your solution, but I can't keep this issue open as it's not actionable.
@guidoffm that specific issue is #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.