0

I am working on a installer, after we install the files we run a script that uses NPM Link to setup some folders.

When I run the script on my VM it works without any errors/warnings. When I try to run it on my own machine I get this error:

84 verbose node v9.5.0

85 verbose npm v5.6.0

86 error path C:\Users\me\AppData\Roaming\npm\node_modules\module

87 error code EEXIST

88 error errno -4075

89 error syscall symlink

90 error EEXIST: file already exists, symlink 'C:\Users\me\AppData\Roaming\npm\node_modules\module' -> target folder

91 error File exists: C:\Users\Me\AppData\Roaming\npm\node_modules\module

92 error Move it away, and try again.

93 verbose exit [ -4075, true ]

Now I know this file already exists, I already linked it. But I am not getting this error on my VM where I do the exact same thing. Do I need to remove the node_module everytime I link it? That can't be right, right?

I already re-installed NodeJS on my own machine.

This is basically what I do:

call NPM link ..\Folder1 
call NPM link ..\Folder2
call NPM link ..\Folder3

And I have to do this for multiple folders. Some folders need to have all 3 linked, others just the 1 or the 2. So for every folder I do this in, I get the error for every operation. It does the linking but I really want to get rid of the error, especially cause it works on my VM.

I already tried to go in to the folders and call NPM Link (without arguments) but that doesn't seem to do anything.

Community
  • 1
  • 1

1 Answers1

5

Found out what was the problem.

First you run NPM Link (No arguments) in the source folder.

NPM Link

Then you run NPM Link module_name in the target folder.

NPM Link [module_name]

So use the module_name instead of the location.