1

While installing angular CLI on Red hat linux I'm getting below errors. Though I can see ng -v output. But due to below error I'm not able to do the ng build or ng serve.

**[root@VMEEPADV07 /]# npm install -g @angular/cli  --force**
npm WARN using --force I sure hope you know what you are doing.
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng

    enter code here

> [email protected] install /usr/lib/node_modules/@angular/cli/node_modules/fsevents
> node install

internal/modules/cjs/loader.js:573
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/@angular/cli/node_modules/fsevents/install'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
    at Function.Module._load (internal/modules/cjs/loader.js:497:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
    at startup (internal/bootstrap/node.js:228:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)

> @angular/[email protected] postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/ng-update-message.js

internal/modules/cjs/loader.js:573
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/@angular/cli/bin/ng-update-message.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
    at Function.Module._load (internal/modules/cjs/loader.js:497:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
    at startup (internal/bootstrap/node.js:228:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)
+ @angular/[email protected]
added 320 packages from 209 contributors in 10.148s
5
  • Which node (version) are u using? Commented May 16, 2018 at 14:24
  • try running npm cache clean --force Otherwise rm -rf node_modules/ and then npm install Commented May 16, 2018 at 14:31
  • Node Version v10.1.0 NPM Version 6.0.1 Commented May 16, 2018 at 14:40
  • Tried this but showing the same error. This problem dosen't comes on windows Commented May 16, 2018 at 14:49
  • Interesting thing is this file "/usr/lib/node_modules/@angular/cli/bin/ng-update-message.js" is already there Commented May 16, 2018 at 14:57

2 Answers 2

1

I had the same error, and this is the solution that seemed to work:

sudo npm install -g @angular/cli --unsafe-perm=true
Sign up to request clarification or add additional context in comments.

Comments

0

In my case, I had to change file permissions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.