Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yeoman. The filename, directory name, or volume label syntax is incorrect

Tags:

yarnpkg

yeoman

Reinstalled Windows 10 (Version 10.0.14393). Reinstalled the following:

  • Java

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

  • nodejs (v6.9.5)
  • NPM (3.10.10)
  • Yarn (v0.19.1)
  • Yeoman (installed with yarn global add yo)

When I write yo -v in cmd in any folder, runned with administrator or not, I take:

The filename, directory name, or volume label syntax is incorrect.

UPDATE:
The only workaround I found is to use the full path of yo:

C:\Users\<username>\AppData\Local\Yarn\config\global\node_modules\.bin\yo.cmd
like image 582
Feeco Avatar asked Feb 08 '17 05:02

Feeco


People also ask

What does it mean the filename directory name or volume label syntax is incorrect?

Renaming files to include invalid characters will result in the error "The filename, directory name, or volume label syntax is incorrect." 1) Create a file that has an invalid symbol in the file name (ex. <, >, /, \, :, or |). 2) Attempt to transfer the file in either MOVEit Transfer or MOVEit Automation.


1 Answers

It may be that your PATH does not point to global NPM modules yet. The FAQ and links are more helpful for gnu/linux or mac users. The PATH is a list of the places that your operating system checks whenever you type a command.

Since you are using Windows, to add the modules path temporarily (just for one session) at the prompt, just type (obviously use the correct path with your correct username and please take note of the ; separator character):

path = %path%;C:\Users\<username>\AppData\Local\Yarn\config\global\node_modules\.bin\

You should then be able to run 'yo -v' without pointing to the full path name, since the console now knows to check that folder also. If that works for you, you can add that path permanently using the instructions described on another SO post here.

Finally (and this is only slightly related to your question), since i notice you've got the Windows 10 anniversary update, if you have Linux experience, you may prefer to use "Windows subsystem for Linux", which is a bash shell (Ubuntu 14) on Windows, that you can use instead of the default command prompt. You can find it under "Add / Remove programs --> Turn Windows features on or off --> (scroll right down) --> Windows subsystem for Linux (beta)". Your local file system will be at "/mnt/c" so you can get to it from within the shell or from windows explorer. I've had fewer problems using this and since so many tutorials are written with bash (not command prompt) in mind, it's useful to use it instead of cmd.

You'll need to install dependencies in the usual way using apt-get (as it won't use the ones you've installed on the windows side) and you'll need to prefix commands that make system changes with 'sudo'. e.g.

sudo npm -g modulename
like image 145
fzzylogic Avatar answered Sep 18 '22 03:09

fzzylogic