Skip to content

Angular CLI postinstall script fails (with global flag), due to absence of ng-update-message.js  #10728

@baker-james

Description

@baker-james

Versions

Node: v8.11.0
NPM: 5.6.0
OS: Linux Fedora 28

Repro steps

sudo npm install -g @angular/cli

Observed behavior

/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng

> @angular/cli@6.0.0 postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/ng-update-message.js

module.js:549
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/@angular/cli/bin/ng-update-message.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @angular/cli@6.0.0 postinstall: `node ./bin/ng-update-message.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @angular/cli@6.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-05-08T12_16_40_014Z-debug.log

Desired behavior

The file ng-update-message.js is found, allowing NPM to install the Angular CLI globally

Mention any other details that might be useful (optional)

The install is successful if installed locally, by running...

cd ~/Desktop
npm install @angular/cli

In this case, ng-update-message.js is present under node_modules/@angular/cli/bin/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions