學習vue

vue時候出現的bug。

環境:

win10.

node v6.10.3
npm  v3.10.10

使用vue創建項目的時候出現的問題。

使用vue init webpack-simple projectname 可以正常運行

但是使用vue init webpack projectname一直報一下的錯誤。苦惱百度了一個下午。

網上介紹可能出現的問題:端口被佔用之類,但是我改了之後還是報這個錯誤。

最後手動註釋掉dev-server.js的require(“./check-versions.js”)才正常運行,問題應該出現在semver文件,但是我的semver是 npm install semver 安裝的,並不知道爲什麼有問題。


E:\GitHub\vue\test>npm run dev

> [email protected] dev E:\GitHub\vue\test
> node build/dev-server.js

E:\GitHub\vue\test\node_modules\semver\semver.js:293
    throw new TypeError('Invalid Version: ' + version);
    ^

TypeError: Invalid Version: 3.10.10
    at new SemVer (E:\GitHub\vue\test\node_modules\semver\semver.js:293:11)
    at Range.test (E:\GitHub\vue\test\node_modules\semver\semver.js:1036:15)
    at Function.satisfies (E:\GitHub\vue\test\node_modules\semver\semver.js:1085:16)
    at module.exports (E:\GitHub\vue\test\build\check-versions.js:29:17)
    at Object.<anonymous> (E:\GitHub\vue\test\build\dev-server.js:1:90)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script 'node build/dev-server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\GitHub\vue\test\npm-debug.log

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章