Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Grunt构建生产环境,angularJS nomod错误_Javascript_Angularjs_Node.js_Gruntjs - Fatal编程技术网

Javascript Grunt构建生产环境,angularJS nomod错误

Javascript Grunt构建生产环境,angularJS nomod错误,javascript,angularjs,node.js,gruntjs,Javascript,Angularjs,Node.js,Gruntjs,我构建了一个由yeoman搭建的angularJS应用程序,并使用 grunt serve 正如我预期的那样,但是当我尝试使用 grunt build 然后用nodemon运行它,除了页眉/页脚,我没有得到任何内容,我的chrome javascript控制台给了我以下错误 Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:nomod] Modu

我构建了一个由yeoman搭建的angularJS应用程序,并使用

grunt serve
正如我预期的那样,但是当我尝试使用

grunt build
然后用nodemon运行它,除了页眉/页脚,我没有得到任何内容,我的chrome javascript控制台给了我以下错误

 Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.12/$injector/nomod?p0=myApp
    at http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:20442
    at http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:28774
    at b (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:28346)
    at b (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:28658)
    at http://localhost:3000/scripts/vendor.c0d4f7d6.js:4:5159
    at f (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:20827)
    at n (http://localhost:3000/scripts/vendor.c0d4f7d6.js:4:4937)
    at Sb (http://localhost:3000/scripts/vendor.c0d4f7d6.js:4:6627)
    at h (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:26459)
    at _ (http://localhost:3000/scripts/vendor.c0d4f7d6.js:3:26769)
http://errors.angularjs.org/1.3.12/$injector/modulerr?p0=myApp&p1=E…0(http%3A%2F%2Flocalhost%3A3000%2Fscripts%2Fvendor.c0d4f7d6.js%3A3%3A26769)vendor.c0d4f7d6.js:3 (anonymous function)vendor.c0d4f7d6.js:4 (anonymous function)vendor.c0d4f7d6.js:3 fvendor.c0d4f7d6.js:4 nvendor.c0d4f7d6.js:4 Sbvendor.c0d4f7d6.js:3 hvendor.c0d4f7d6.js:3 _vendor.c0d4f7d6.js:3 $vendor.c0d4f7d6.js:7 (anonymous function)vendor.c0d4f7d6.js:2 _.Callbacks.kvendor.c0d4f7d6.js:2 _.Callbacks.l.fireWithvendor.c0d4f7d6.js:2 _.extend.readyvendor.c0d4f7d6.js:1 g

我基本上是遵循这一点,当我做npm开始时,我基本上得到了一个空白页。有什么建议吗?

您的myApp模块未加载,这就是您出现此错误的原因。你能确认你的javascript文件加载正确吗?你是如何定义你的模块myApp的?@Rebornix我做了[app name here]并且它自动搭建了,在那之后,当我尝试grunt构建然后运行express时,它给我这个错误。只要给我看看app.js,我就可以知道你的应用是如何定义的。