1、出现此种错误
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-07-28T09_53_43_298Z-debug.log
大概意思就是说:
PM犯错!超过最大调用堆栈大小
NPM犯错!此运行的完整日志可以在:
NPM犯错!C:\用户\ guoyicheng \ AppData \漫游\ \ \ 2017-09-28t03_03_25_358z-debug.log _logs NPM缓存
这时候你就需要给自己的npm升级或者降级了
降级 : npm install -g [email protected]
升级 : npm install -g npm 升级到最新版
2、
pm install出现”Unexpected end of JSON input while parsing near”错误
这时候就要清一下栈了:
npm cache clean --force
3、安装vue-cli的时候出现错误:
安装报错信息:
C:\Users\admin\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\node_modules\tar\lib\parse.js:33
const gzipHeader = Buffer.from([0x1f, 0x8b])
^
TypeError: this is not a typed array.
at Function.from (native)
at Object.
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.
at Module._compile (module.js:409:26)
出现此问题的原因是:安装的node版本太低导致
解决方案:
a.通过终端更新node版本。
b.自行到官网https://nodejs.org/dist/去找新版本。
4、
> [email protected] start C:\111
> node build/dev-server.js
> Starting dev server...
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8080
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1355:14)
at listenInCluster (net.js:1396:12)
at Server.listen (net.js:1480:7)
at Function.listen (C:\111\node_modules\express\lib\application.js:618:24)
at Object.
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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! C:\Users\Tom Lee\AppData\Roaming\npm-cache\_logs\2018-09-04T01_38_35_534Z-debug.log
错误原因:端口号已被占用,找到端口号,关闭它。最有可能是网页已在浏览器中打开。
5.用脚手架建立vue项目时遇到的错误
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
解决方法:
npm install appium-chromedriver --chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver