Skip to content

ng --version errors without node_modules dir #10917

Closed
@davidkassa

Description

@davidkassa

Versions

debian jesse FROM node:latest

$ node --version
v10.1.0
$ npm --version
5.6.0
success Installed "@angular/[email protected]" with binaries

Repro steps

Using GitLab CI:

image: davidkassa/yarn-angular-cli-firebase-tools:latest
before_script:
 - node --version
 - npm --version
 - ng --version

Observed behavior

$ ng --version
ENOENT: no such file or directory, scandir '/builds/davidkassa/shot-club-web/node_modules'
Error: ENOENT: no such file or directory, scandir '/builds/davidkassa/shot-club-web/node_modules'
    at Object.fs.readdirSync (fs.js:875:3)
    at VersionCommand.run (/usr/local/share/.config/yarn/global/node_modules/@angular/cli/commands/version.js:48:19)
    at /usr/local/share/.config/yarn/global/node_modules/@angular/cli/models/command-runner.js:278:30
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/share/.config/yarn/global/node_modules/@angular/cli/models/command-runner.js:4:58)
ERROR: Job failed: exit code 1

Desired behavior

I would expect version information to be given even if there is not a node_modules/ directory present

Mention any other details that might be useful (optional)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions