Error creating new project using Angular-cli

When I try to create a new project using the ng new project-name command , I get an error as shown below:

fs.js: 640 return binding.open (pathModule._makeLong (path), stringToFlags (flags), mode); ^

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

  • ubuntu 14.04 64-bit
  • node 6.6.0
  • npm 3.9.5
  • angular -cli@1.0.0-beta.14

I suspect some problems installing angular-cli, but I'm not sure. Any help would be helpful.

+4
source share
3 answers

I had the same problem and this post was useful: https://github.com/angular/angular-cli/issues/2135

It may be too bad to really recommend as a solution, but this answer at least got me going:

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

+2
source

, :

  npm uninstall -g angular-cli
  npm cache clean
  npm install -g node-gyp
  npm install -g angular-cli

ng -version, , .

+2

Try npm install -g webpacktonpm install -g angular-cli

0
source

Source: https://habr.com/ru/post/1654877/


All Articles