Angular ng new returns package install failed error - compiler.umd.js missing

前端 未结 3 1460
北恋
北恋 2021-01-28 05:17

I am trying to learn Angular and am following an online tutorial. However, I can\'t seem to get past creating a new project with ng new. I am running node v10.16.0 and npm 6.9.0

相关标签:
3条回答
  • 2021-01-28 06:05

    For some reasons when angular/cli (ng) run npm install by itself, it have problem with packages writing, so you can run

    ng new yourProject --skipInstall=true
    

    so angular/cli will not install any node packages and then run

    npm install --force
    

    to install it by yourself

    0 讨论(0)
  • 2021-01-28 06:06

    I've faced like this issue and the solution was:

    1. Go to Edit the system environment variables.
    2. Under User variables for User ==> Path, Make sure C:\Users\user\AppData\Roaming\npm its above all, and make sure you are add current user directory.

    Note: If you don't have current user directory you have to create it.

    3.Under System variables ==> Path, Make sure *C:\Program Files\nodejs* its above all.

    1. Open Command Prompt as user ==> npm cache clean --force.
    2. npm install -g npm@latest.
    3. ng new yourApp.
    4. ng serve --open.
    0 讨论(0)
  • 2021-01-28 06:21

    are you working offline? you need to be online, so that npm can download the dependencies for the project.

    0 讨论(0)
提交回复
热议问题