新项目启动报错
1.报错原因
pm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/vue failed, reason: connect ETIMEDOUT 104.16.20.35:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administator\AppData\Roaming\npm-cache\_logs\2020-08-04T07_11_33_323Z-debug.log
解决方案:
现在连接https://registry.npmjs.org/vue 下载架包,无法连接到reason: connect ETIMEDOUT 104.16.20.35:443
换个安装:npm install -g cnpm --registry=https://registry.npm.taobao.org 执行
再次执行:npm install
2.报错原因
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\vue-fancybox\vue-touch@git:\github.com\vuejs\vue-touch.git#5229b018a0c71618851e98fc40c4697e42bf68b8" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administator\AppData\Roaming\npm-cache\_logs\2020-08-04T07_21_11_718Z-debug.log
解决方案:
删除: package-lock.json文件
再次执行:npm install
3.报错原因
29 packages are looking for funding
run `npm fund` for details
found 15 vulnerabilities (3 low, 8 moderate, 4 high)
run `npm audit fix` to fix them, or `npm audit` for details
解决方案:
按照提示执行:npm audit fix
执行项目启动:npm run dev
终于运行成功: