Laravel 第四張學習——優化頁面(1)

gongmeng發表於2019-11-25

執行 yarn add cross-env 報錯 :
   error An unexpected error occurred: "EIO: i/o error, symlink '../../../parser/bin/babel-parser.js' -> '/home/vagrant/Code/weibo/node_modules/@babel/core/node_modules/.bin/parser'".
解決方案:
   執行 yarn add cross-env --save --no-bin-links

再次執行 npm run dev 報錯:
  sh: 1: cross-env: not found
  npm ERR! file sh
  npm ERR! code ELIFECYCLE
  npm ERR! errno ENOENT
  npm ERR! syscall spawn
  npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
  npm ERR! spawn ENOENT
  npm ERR!
  npm ERR! Failed at the @ development 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! /home/vagrant/.npm/_logs/2019-11-25T09_47_21_201Z-debug.log
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! @ dev: npm run development
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the @ dev 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:
解決方案:去掉 package.json裡面的 cross-env

再次執行 npm run dev 未報錯,提示如下:
  Additional dependencies must be installed. This will only take a moment.
  Running: npm install vue-template-compiler --save-dev --production=false
嘗試解決方案:
  按照提示執行 npm install vue-template-compiler --save-dev --production=false
     再次報錯:
       npm ERR! path /home/vagrant/Code/weibo/node_modules/.vue-template-compiler.DELETE/.nfs000000000001146200000001
       npm ERR! code EBUSY
       npm ERR! errno -16
       npm ERR! syscall unlink
       npm ERR! EBUSY: resource busy or locked, unlink '/home/vagrant/Code/weibo/node_modules/.vue-template-compiler.DELETE/.nfs000000000001146200000001'
       npm ERR! A complete log of this run can be found in:
       npm ERR! /home/vagrant/.npm/_logs/2019-11-25T09_56_15_438Z-debug.log
       由於技術盲點,此錯誤沒有解決;還望看到文章的大神幫忙一下;萬般無奈之下,繼續執行 npm run dev,竟然成功了;

相關文章