解决Homestead yarn , npm run dev, 命令报错问题!

解决Homestead yarn , npm run dev, 命令报错问题!

 版权声明:本文为博主原创,未经博主同意,不得转载! https://blog.csdn.net/qq_39188306/article/details/80535663

    在写本文之前,我因为这个报错差点怀疑人生了,到处问到处查,最后总算是解决了,下面就直接开门见山了:

当你执行yarn install你就会发现报以下错误

解决办法:

1、首先手动删除项目中node_modules文件夹的所有内容   或   执行 $ rm -rf node_modules

2、其次执行 $ yarn config set registry http://registry.cnpmjs.org

3、再次执行 $ yarn install --no-bin-links

4、接下来打开根目录下的 pakage.json 文件, 去掉4处 cross-env

最后执行 $ npm run watch-poll 或者 npm run dev,这样就完成了!

如果还是安装失败:

则执行 $ yarn config set registry https://registry.npm.taobao.org再执行 $ yarn install

如果仍然安装失败:

    1:关闭代理 
        $ npm config set proxy null
    2:安装淘宝镜像

        $ npm config set registry https://registry.npm.taobao.org

        $ npm info underscore

    3:$ yarn install 安装node-modules

原文地址:https://www.cnblogs.com/guiyishanren/p/10964092.html