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-clientnewag01-dmhtct-clien
tsrcassets***, D:3501dmhp-clientnewag01-dmhtct-clientsrcindex.html, D:3501dmhp-clientnewag01-dmhtct-clientsrcmanifest.json, D:3501dmhp-clientnewag01
-dmhtct-clientsrcservice-worker.js, D:3501dmhp-clientnewag01-dmhtct-client
ode_modulesioniconsdistfonts***, D:3501dmhp-clientnewag01-dmhtct-client
od
e_modulesionic-angularfonts***, D:3501dmhp-clientnewag01-dmhtct-client
ode_modulesionic-angularpolyfillspolyfills.js, D:3501dmhp-clientnewag01-dmhtct-
client
ode_modulessw-toolboxsw-toolbox.js
at BuildError.Error (native)
at new BuildError (D:3501dmhp-clientnewag01-dmhtct-client
ode_modules@ionicapp-scriptsdistutilerrors.js:16:28)
at Timeout._onTimeout (D:3501dmhp-clientnewag01-dmhtct-client
ode_modules@ionicapp-scriptsdistwatch.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-clientnewag01-dmhtct-client
ode_modulesionic-angularpackage.json'
at Error (native)
无法编译 尽然没有ionic-angular 。 被自己蠢哭。
安装 继续报错
npm ERR! enoent ENOENT: no such file or directory, rename 'D:3501dmhp-clientnewag01-dmhtct-client
ode_modulesionic-angular' -> 'D:3501dmhp-clientnewag01-dmh
tct-client
ode_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源
重新安装
安装成功
重新运行
该问题解决。
粗心害死人 ! 好奇害死猫。