npm 错误总结(不定期更新)

1.Error: Cannot find module 'bower'( Cannot find module 'XXX')

找不到bower  (缺少这个)

解决办法:npm install bower   (npm install XXX)

这种情况一般是少安装某个依赖包所导致的   可以直接运行 npm install  然后在 npm run dev 或者 npm run start 试一下。

 

 

2.Port 4200 is already in use. Use '--port' to specify a different port  

出现这个问题就是端口被占用,

解决办法:ng serve --port 4201  

单纯的敲了这一行命令之后

你会发现还是不行

 因为还要修改  node_modules\@angular\cli\lib\config\schema.json  中的 serve 下的 "default":4201

在运行

        

 

然后在运行 就可以了

3.ERROR in multi script-loader!./~/bootstrap/dist/js/bootstrap.bundle.js
Module not found: Error: Can't resolve 'D:\angular\ng\customer-app\node_modules\bootstrap\dist\js\bootstrap.bundle.js' in 'D:\angular\ng\customer-app\node_modules\@angular\cli\mode
ls\webpack-configs'
 @ multi script-loader!./~/bootstrap/dist/js/bootstrap.bundle.js

 

ng serve  的时候报的错

意思是找不到解析不了这个模块

后面跟了一串路径   很明显路径写错了

添加路径的地方只有  angular-cli.json里面  (ng6 angular-cli好像改名了)

根据报错提示 打开angular-cli.json  找到 scripts  再打开文件夹对比  

很明显我路径引入的时候多写了一个bundle

删除了在运行

ng  serve   

 

报错完美解决

 

npm install 报错

删除node-model 

运行 npm cache clean --force

再重新 npm install

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值