ionic 菜鳥
運行ionic serve提示找不到index.html .
[09:19:00] Failed to load index.html
{ Error: A watch configured to watch the following paths failed to start. It likely that a file referenced does not exist: D:\3501dmhp-clientnew\ag01-dmhtct-clien
t\src\assets\**\*, D:\3501dmhp-clientnew\ag01-dmhtct-client\src\index.html, D:\3501dmhp-clientnew\ag01-dmhtct-client\src\manifest.json, D:\3501dmhp-clientnew\ag01
-dmhtct-client\src\service-worker.js, D:\3501dmhp-clientnew\ag01-dmhtct-client\node_modules\ionicons\dist\fonts\**\*, D:\3501dmhp-clientnew\ag01-dmhtct-client\nod
e_modules\ionic-angular\fonts\**\*, D:\3501dmhp-clientnew\ag01-dmhtct-client\node_modules\ionic-angular\polyfills\polyfills.js, D:\3501dmhp-clientnew\ag01-dmhtct-
client\node_modules\sw-toolbox\sw-toolbox.js
at BuildError.Error (native)
at new BuildError (D:\3501dmhp-clientnew\ag01-dmhtct-client\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
at Timeout._onTimeout (D:\3501dmhp-clientnew\ag01-dmhtct-client\node_modules\@ionic\app-scripts\dist\watch.js:71:20)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5) hasBeenLogged: false, isFatal: false }
觀察目錄 發現index.html 存在。 一直無法解決。
查看生成的www文件夾。發現沒有任何生成。
運行ionic build
Running app-scripts build:
[09:53:22] build dev started ...
Error: ENOENT: no such file or directory, open 'D:\3501dmhp-clientnew\ag01-dmhtct-client\node_modules\ionic-angular\package.json'
at Error (native)
無法編譯 盡然沒有ionic-angular 。 被自己蠢哭。
安裝 繼續報錯
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\3501dmhp-clientnew\ag01-dmhtct-client\node_modules\ionic-angular' -> 'D:\3501dmhp-clientnew\ag01-dmh
tct-client\node_modules\.ionic-angular.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
查看npm config edit
發現registry竟然沒有。
原因可能是用txt打開過,公司加密軟件給加密了
重新設置npm源
重新安裝
安裝成功
重新運行
該問題解決。
粗心害死人 ! 好奇害死貓。