2016-10-04 99 views
3

我刚刚创建了一个新的Ionic 2 rc0应用程序,昨晚我能够运行它。如果我创建一个新的应用程序离子服务器无法使用Ionic 2 rc0应用程序

Running 'serve:before' npm script before serve 
> [email protected] watch J:\ionic projects\newionicapp 
> ionic-app-scripts watch 
module.js:457 
    throw err; 
    ^

Error: Cannot find module '../dist/index' 
    at Function.Module._resolveFilename (module.js:455:15) 
    at Function.Module._load (module.js:403:25) 
    at Module.require (module.js:483:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (J:\ionic projects\newionicapp\node_modules\@ionic\app-scripts\bin\ionic-app-scripts.js:19:3) 
    at Module._compile (module.js:556:32) 
    at Object.Module._extensions..js (module.js:565:10) 
    at Module.load (module.js:473:32) 
    at tryModuleLoad (module.js:432:12) 
    at Function.Module._load (module.js:424:3) 



npm 
ERR! Windows_NT 10.0.10586 
npm ERR! argv "J:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\rosst\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch" 
npm ERR! node v6.7.0 
npm ERR! npm v3.10.8 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] watch: `ionic-app-scripts watch` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] watch script 'ionic-app-scripts watch'. 
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 ionic-hello-world package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ionic-app-scripts watch 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ionic-hello-world 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ionic-hello-world 
npm 
ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  J:\rosst\ionic projects\newionicapp\npm-debug.log 

Caught exception: 
undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues 

,它运行良好:

然而,把电脑,而离子的发球运行睡觉,试图结束今天离子后,启动应用程序后,发球得到这个错误。所以我认为我的项目里面爆发了一些东西但我不知道是什么。

+1

不确定为什么有人投下了这个问题,所以在投票时应该有一些选项可以添加评论。 :)。 Coz这是下来投票下主题,但问题似乎合法我 – sameera207

+0

你也可以尝试删除整个'node-modules'文件夹,然后再次运行'npm install' ... – sebaferreras

+1

@sebaferreras这工作对我来说包括删除'.tmp'文件夹。 – Ivaro18

回答

10

删除您的node_modules文件夹然后运行npm install重新安装所有模块。这将确保所有节点模块都干净。

还删除您的www文件夹中的内容,然后运行离线服务重新生成文件。这将确保您的项目构建清洁。

如果这不起作用,请尝试通过运行npm install -g [email protected]将您的ionic-cli更新为最新版本,然后再次尝试上述操作。

Ionic CLI使用不是特定目标版本的ionic-app-scripts版本。离子应用脚本已更新,尽管离子应用脚本尚未更新,但它现在使用更新版本的离子应用脚本,这对我造成了一些问题。

祝你好运!

0

我发现有点类似error,它看起来像它与更新npm有关。

所以尝试更新npm到最新。 read here关于步骤升级。 PS:但是这并不能解释为什么它适用于新项目。 :)

7

尝试更新离子应用程序脚本。

npm i @ionic/app-scripts

它为我工作。

+0

这对我有用!谢谢! – makinbacon

3

我有同样的问题,我研究了很多,找到一个解决办法试试你的终端上运行此命令 -

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p 
0

我有这个问题了很多东西。 我搜索互联网,并尝试了所有可能的解决方案,没有运气。

我终于发现,从应用程序名称中删除空格使所有的工作。因此,删除所有内容的det app文件夹,并创建一个名称中没有空格的新文件夹。

无论如何,这对我来说很有效。

+0

看来问题中的问题不是多余的空格 – yass

相关问题