npm run dev 的正确使用姿势
想必使用window平台开发Laravel项目的童鞋在面对构建前端工作流时出现很多问题,现将自己遇到填坑方式分享与大家
开发环境: win10、Homestead
准备工作
win10 使用管理员权限打开 Git 命令行终端(切记)
homestead 环境中最好是切换到 sudo
vagrant ssh
登录成功后切换到项目路径
安装node_modules
sudo yarn install --no-bin-links
如果报错 The engine “node” is incompatible with this module,执行如下命令
yarn config set ignore-engines true
继续执行如下命令
sudo yarn install --no-bin-links
sudo yarn add cross-env --save --no-bin-links
sudo yarn add vue-template-compiler --save-dev --production=false --no-bin-links
最后编译生成 css与js 文件
sudo npm run watch-poll
一点声明与建议
也没啥,简而言之的就是条件许可的话换黑Mac吧,避免陷入环境之坑!
本作品采用《CC 协议》,转载必须注明作者和本文链接