4

Google Drive for desktop : Firstly, I'm using 'Google Drive for desktop' (formally called Google Drive Filestream) which gives me a G: where I can access all my Google Drive Files and Folders from my computer without Internet connection : https://support.google.com/a/users/answer/9965580?hl=en

Essentially, the desktops on all our computers are set to this same G: drive so we can hop on any of our five computers, and start working exactly where we left off from any computer, and all desktop files and folders are changed in sync.

Node JS : When in the Hyper command prompt, within G:, I've created the index.js file within a project folder and then initialized npm with npm init. This created the following package.json file inside the project folder:

{
  "name": "nodejs",
  "version": "1.0.0",
  "description": "intro to node",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "me",
  "license": "ISC"
}

But, when I try to use npm install, for example: npm install superheroes from https://www.npmjs.com/package/superheroes I get the following errors:

npm ERR! code EEXIST
npm ERR! syscall mkdir
npm ERR! path G:\My Drive\NodeJS\node_modules\.staging
npm ERR! errno -4075
npm ERR! EEXIST: file already exists, mkdir 'G:\My Drive\NodeJS\node_modules\.staging'
npm ERR! File exists: G:\My Drive\NodeJS\node_modules\.staging
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.  
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<my_user_name>\AppData\Roaming\npm-cache\_logs\2021-05-17T01_14_42_782Z-debug.log

There is a similar post here: How to make a node.js project in Google Drive Filestream

I've tried removing the space in the path file name My Drive thinking this might be causing the 4075 error but was unsuccessful.

I know this is not recommended practice, as most will use Git Hub in this situation, but is it possible?

Thank you!

  • have you solved this problem? I'm dealing with similar issue: "npm install" is not working appropriately with Google Drive for Desktop. Do you have some suggestion? Thanks! – Flavio Vilante Sep 14 '21 at 11:51
  • Yes! resolved this issue by placing the project folder on my computer's drive (desktop, C:, wherever), then just include that folder in the drive sync list of folders. It seems that there's an issue having git/node write to a Google Drive for Desktop drive, but it works just fine to store the project locally and mirror that folder to Drive. – shaedopotato Mar 23 '22 at 15:58

3 Answers3

2

Hi i had the same problem and the solution is pretty simple, i recommend you to create a remote repository in your google drive folder and clone it in your computer folders, of course you should have the repository folder in your local Google Drive. you can initializate your remote repository with git init --bare i let you here a very simple tutorial

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30967988) – tomerpacific Feb 06 '22 at 07:10
2

This issue was resolved by placing the project folder on my computer's drive (desktop, C:, wherever), then just include that folder in the drive sync list of folders.

It seems that there's an issue having git/node write to a Google Drive for Desktop drive, but it works just fine to store the project locally and mirror that folder to Drive.

shaedopotato
  • 457
  • 1
  • 3
  • 12
0

As far as I can tell, npm install does not work within G:\My Drive. The solution I use is not elegant, but the cost is outweighed by the benefit of having my work files synced between my computers and always being backed up by Google Drive.

The work around I use is to:

  1. Create a folder on my physical computer's drive.
  2. npm init and npm install my packages into that folder.
  3. Copy the 'node-modules', 'package.json', and 'package-lock.json' from my physical computer into my working directory within G:\.
  4. Say YES to replacing all duplicate files. Only the three aforementioned files will be replaced.
  5. Execute the dependent files within my working directory to ensure they function as intended.
  6. Have Google Drive sync the folder on my machine to retain access and update whenever I leave said machine.
G P
  • 1
  • 3