简体   繁体   中英

Meteor - ReferenceError: angular is not defined

I am following this tutorial but midway through step 1 have run into an error. Despite following the tutorial exactly I'm getting the following errors:

W20160229-17:37:07.465(0)? (STDERR)
W20160229-17:37:07.465(0)? (STDERR) C:\Users\user\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
W20160229-17:37:07.465(0)? (STDERR)                                             throw(ex);
W20160229-17:37:07.465(0)? (STDERR)                                                   ^
W20160229-17:37:07.465(0)? (STDERR) ReferenceError: angular is not defined
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.

The only way I veered from the tutorial is that I am not using the ios or android packages, because I'm on Windows. Could that be the cause?

Either way how can I fix this?

This is probably caused by your app.js file being in the wrong directory. The tutorial sets you up with a file structure like this:

  • Client
    • scripts
    • styles
    • templates
    • index.html
  • lib
  • public
  • server

If you put your app.js inside the root "lib" folder you'll get the "angular is not defined" error. It needs to be in a separate "lib" folder inside the "scripts" directory, like this:

  • Client
    • scripts
      • lib
        • app.js

You should be able to run the app after moving it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM