第一个坑,cross-env目录不对
sh: node_modules/cross-env/bin/cross-env.js: No such file or directory
我查了一下cross-env.js
的路径,发现它是在node_modules/cross-env/dist/bin
下面而不是node_modules/cross-env/bin
下面。
修改方案
是修改package.json
下面的node_modules/cross-env/bin/cross-env.js
为node_modules/cross-env/dist/bin/cross-env.js
第二个坑,laravel-mix版本太低
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.path: The provided value "public" is not an absolute path!
要把package.json
里面laravel-mix
版本改成
"laravel-mix": "^0.10.0",
然后再执行
npm install