%AppData% causes: Error parsing appveyor.yml: While scanning for the next token, find character that cannot start any token

saper's Avatar

saper

23 Aug, 2015 10:06 AM

As a follow-up to node.js connectivity issues I started implementing the build cache.

Using just plain directory names seems to work:

cache:  
  - c:\Users\appveyor\.node-gyp
  - c:\Users\appveyor\AppData\Roaming\npm-cache

working appveyor.yml file

Then I follow the build cache guide and use environmental variable (%AppData%) instead like this:

cache:  
  - c:\Users\appveyor\.node-gyp
  - %AppData%\npm-cache

broken appveyor.yml file - diff to previous

The build fails immediately with a message (wrapped here):

Error parsing appveyor.yml:  
(Line: 13, Col: 5, Idx: 176) - (Line: 13, Col: 6, Idx: 177): 
While scanning for the next token,  
find character that cannot start any token.

Is YAML parser having trouble with the % character? Am I doing something wrong?

  1. Support Staff 1 Posted by Feodor Fitsner on 23 Aug, 2015 10:09 AM

    Feodor Fitsner's Avatar

    Yes, the value starting from % should be in quotes:

    cache:  
      - c:\Users\appveyor\.node-gyp
      - '%AppData%\npm-cache'
    
  2. 2 Posted by saper on 23 Aug, 2015 10:46 AM

    saper's Avatar

    Strange, with quotes added I do not seem to get Restoring... and Saving... messages for the %AppData%\npm-cache in the build log.

  3. Support Staff 3 Posted by Feodor Fitsner on 23 Aug, 2015 10:50 AM

    Feodor Fitsner's Avatar
  4. Support Staff 4 Posted by Feodor Fitsner on 23 Aug, 2015 10:51 AM

    Feodor Fitsner's Avatar

    Also, I've moved your account to a faster environment. Next time you run a build the cache will be re-created.

  5. 5 Posted by saper on 23 Aug, 2015 11:23 AM

    saper's Avatar

    Thank you. Seems to work perfectly. And blazing fast!

  6. saper closed this discussion on 23 Aug, 2015 11:23 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac