angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.72k stars 11.98k forks source link

Could not find the '@angular-devkit/build-angular:dev-server' builder's node package. #22603

Closed lokzzor closed 2 years ago

lokzzor commented 2 years ago

🐞 Bug report

Command

The globally required package has been installed as well as node 16.13.2 angular 13.2.0 npm 8.4.0

Description

Created a clean angular project in docker. 'npm i' was successful. when trying to 'npm start/ ng serve' gave an error. ## πŸ”¬ Minimal Reproduction

πŸ”₯Angular package.json


 "scripts": {
    "start": "npm i && ng serve",
    "startt": "export NODE_OPTIONS=--max_old_space_size=4096 && npm i --no-audit  --legacy-peer-deps && ng serve -c production",
    "vm": "npm i  --no-audit -s --legacy-peer-deps --only=production && npm update && export NODE_OPTIONS=--max_old_space_size=4096 && ng serve -c production --host 0.0.0.0 --port 4200 --disable-host-check",
    "test": "npm i -D --no-audit  --legacy-peer-deps && ng serve -c production"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^13.1.3",
    "@angular/cdk": "^13.1.3",
    "@angular/common": "^13.1.3",
    "@angular/compiler": "^13.1.3",
    "@angular/core": "^13.1.3",
    "@angular/forms": "^13.1.3",
    "@angular/material": "^13.1.3",
    "@angular/platform-browser": "^13.1.3",
    "@angular/platform-browser-dynamic": "^13.1.3",
    "@angular/router": "^13.1.3",
    "@auth0/angular-jwt": "^5.0.2",
    "angular-highcharts": "^13.0.1",
    "angular2-text-mask": "^9.0.0",
    "highcharts": "^9.3.2",
    "moment": "^2.29.1",
    "rxjs": "~7.5.2",
    "tslib": "^2.3.1",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.1.4",
    "@angular/cli": "^13.1.4",
    "@angular/compiler-cli": "^13.1.3",
    "@types/jasmine": "~3.10.3",
    "@types/node": "^17.0.8",
    "jasmine-core": "~4.0.0",
    "karma": "~6.3.10",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.1.0",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "^4.5.5"
  }

🌍 Your Environment



FROM node:16

RUN npm i -g npm@8.3.1
RUN npm i -s -g @angular/cli
RUN npm i -s -g @angular/compiler-cli @angular/language-service @angular-devkit/build-angular

# Set the locale
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV NODE_ENV production
WORKDIR /app
COPY package*.json .
COPY . ./
CMD cd client && ng serve

Anything else relevant?

I went into the docker container and tried to create a new project, and I noticed that with the command 'npm i' in the folder node_modules/@angular-devkit/ no files at all

alan-agius4 commented 2 years ago

The problem is caused because setting the environment variable NODE_ENV to production causes npm install to ignore dev dependencies.

angular-automatic-lock-bot[bot] commented 2 years ago

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.