@angular/cli@8.3.19 postinstall 脚本失败 [英] Failed at the @angular/cli@8.3.19 postinstall script

查看:59
本文介绍了@angular/cli@8.3.19 postinstall 脚本失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用 npm install -g @angular/cli@8.3.19 安装 angular cli.我一直收到这个:

Hi I can't install the angular cli with npm install -g @angular/cli@8.3.19. I keep getting this :

> node ./bin/postinstall/script.js

module.js:549
    throw err;
    ^

Error: Cannot find module '/root/.nvm/versions/node/v13.0.1/lib/node_modules/@angular/cli/bin/postinstall/script.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 ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @angular/cli@8.3.19 postinstall: `node ./bin/postinstall/script.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @angular/cli@8.3.19 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/2019-11-26T00_10_33_515Z-debug.log

节点版本:13.0.1
Npm 版本:6.13.1
Ubuntu 版本:18.04.2

Node version : 13.0.1
Npm version : 6.13.1
Ubuntu version : 18.04.2

我也尝试过不指定 CLI 版本.

I also tried without specifying a CLI version.

推荐答案

我尝试使用我在网上找到的这个命令:

I tried with this command that I found online :

npm install -g @angular/cli@8.3 --unsafe-perm=true --allow-root

它奏效了.

这篇关于@angular/cli@8.3.19 postinstall 脚本失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆