2

the newest node.js 0.12.0 doesnt work together with the sqlite3 package. i found nvm for windows: nvm for windows https://github.com/coreybutler/nvm-windows/releases . i thought nice to use the old and new node.js versions on 1 computer.

after installing nvm for windows in c:\nvm , i get in visual studio 2013 in debug that there is a fault in npm : illigal characters in path resulting in exit debug program . Outside Visual Studio it works fine.

4

2 回答 2

2

As I mentioned in my comment, I had a very similar problem. After installing node.js for purpose of using gulp I could not do a successful build. I would get the following error:

C:\Visual Studio Projects\MyProject\packages\RazorGenerator.MsBuild.2.2.6\build\RazorGenerator.Ms‌​Build.targets(21,9): error : Illegal characters in path.

After searching around I guessed that the problem had to do with the node.js utilizing "illegally" long path names. For some background go here: https://github.com/joyent/node/issues/6960

My solution was to install the Flatten Packages tool: https://visualstudiogallery.msdn.microsoft.com/cd0b1938-4513-4e57-b9b7-c674b4a20e79?SRC=VSIDE

I ran flatten packages on the "node_modules" folder, tried to build (failed but with a different error), restarted Visual Studio, and everything now seems to build ok. Hope this helps.

UPDATE One thing to keep in mind is that, by design, Flatten Packages will move files up in the directory structure. As a consequence, however, Visual Studio will still look for some of the folder/files in the OLD location; VS will shows the [!] symbol to show that the file was there but no longer is. These old file references can gum up the build, so you need to simply delete these old file references/directories.

于 2015-06-10T18:11:52.117 回答
1

Since this post still is on top when searching for this topic..

I also had this problem with "Illegal characters in path" and found that the best solution for me and my team was to make Visual Studio use the latest npm version (>= 3.0) since the node_modules folder depth doesnt get as deep as with npm2 (used by Visual Studio).

This solution will work for you in the background, not needing to run extra commands and tools for flattening the folder.

See my post here for a complete how to: http://newsweb.se/how-to-use-visual-studio-2015-with-latest-nodejs-npm/

于 2016-05-02T22:51:37.947 回答