Ionic 编译找不到index.html

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源

重新安装

安装成功 

重新运行 

该问题解决。

 

粗心害死人 !   好奇害死猫。  

 

posted @ 2018-04-25 10:16  行走千里  阅读(1143)  评论(0编辑  收藏  举报