Jump to content

NPM and Google Drive Issue

Go to solution Solved by Eigenvektor,
9 hours ago, Stentorian said:

I am aware of the alternatives such as Git and I use GitHub for a majority of my projects.

Can you configure Google drive to exclude files/directories? If so, you'd probably want to exclude everything that's also excluded in the .gitignore file.

 

Alternatively you could create a Git repo on a private server (local or remote) and use that as a backup. Or alternatively compress the source code, then put the .zip on Google drive. Could probably be scripted to automate it to some level.

Hi there. 

 

So I'm currently experiencing some issues with Google Drive and NPM. I am using the new Google Drive on Windows (if I remember correctly, used to be called Google Filestream). 

The issue basically involves the fact that when I do npm install in a Node.JS directory, it tells me that the <PROJECT DIRECTORY>/node_modules folder doesn't exist. Using the same project files and package.json in my local Downloads folder worked absolutely fine and installed everything like it was supposed to. 


The full error is as below: 

npm ERR! code ENOTDIR
npm ERR! syscall mkdir
npm ERR! path G:\My Drive\Coding\1. Node\1. Discord.JS\SleepBot\node_modules
npm ERR! errno -4052
npm ERR! ENOTDIR: not a directory, mkdir 'G:\My Drive\Coding\1. Node\1. Discord.JS\SleepBot\node_modules'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\stent\AppData\Local\npm-cache\_logs\2022-03-13T17_06_01_171Z-debug.log

The log file mentioned above has been attached to this post. 

 

And my package.json: 

{
  "name": "sleepbot",
  "version": "1.0.0",
  "description": "A custom bot to fix the brat's sleep schedule",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "sleepbot"
  ],
  "author": "Stentorian",
  "license": "ISC",
  "dependencies": {
    "ascii-table": "^0.0.9",
    "chalk": "^4.1.2",
    "cron": "^1.8.2",
    "discord.js": "^13.6.0",
    "fs": "^0.0.1-security",
    "moment": "^2.29.1",
    "ms": "^2.1.3"
  }
}

 

If anyone could help, that'd be great!

 

2022-03-13T17_06_01_171Z-debug.log

PC: 

Spoiler

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P3 2TB M.2

SSD: Crucial BX500 1TB SSD

SSD: Crucial P2 500GB M.2

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

"Server": 

Spoiler

Motherboard: X99 RSA mATX (eBay special)

CPU: Intel Xeon E5-2680 v4 @ 2.4GHz

Memory: 64GB (2x32GB) Dataram ECC DDR4

Graphics Card: NVIDIA Quadro P2000

Boot: Kingston NV3 1TB M.2

PSU: Corsair CX550

Case: Fractal Design Core 1000

OS: Proxmox Virtual Environment

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Watch: Google Pixel Watch

 

Headphones: SteelSeries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

 

Car: 2010 Mazda 3 Takuya - 1.6L Petrol 103bhp

Link to comment
https://linustechtips.com/topic/1417879-npm-and-google-drive-issue/
Share on other sites

Link to post
Share on other sites

Having Node.js projects on a synchronized folder is a bad idea, especially when you can't make it exclude the node_modules folder (which is the case for Google Drive). It causes issues like this, and the folder occupies a large amount of space. The best way to resolve this is to simply use something else (ideally not using a sync'd folder). There are a lot of posts online detailing how bad of an idea this is

🙂

Link to post
Share on other sites

If you want to share code between different machines or dual boot, use something that was designed for this, e.g. Git in the form of GitHub or GitLab.

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

22 hours ago, duncannah said:

Having Node.js projects on a synchronized folder is a bad idea, especially when you can't make it exclude the node_modules folder (which is the case for Google Drive). It causes issues like this, and the folder occupies a large amount of space. The best way to resolve this is to simply use something else (ideally not using a sync'd folder). There are a lot of posts online detailing how bad of an idea this is

13 hours ago, Eigenvektor said:

If you want to share code between different machines or dual boot, use something that was designed for this, e.g. Git in the form of GitHub or GitLab.

I am aware of the alternatives such as Git and I use GitHub for a majority of my projects. This is just as a backup for anything that I haven't committed and I have a lot of projects that although GitHub has private projects, I don't want to put on GitHub and afterall, I don't pay for 100GB Google Drive for nothing. 

PC: 

Spoiler

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P3 2TB M.2

SSD: Crucial BX500 1TB SSD

SSD: Crucial P2 500GB M.2

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

"Server": 

Spoiler

Motherboard: X99 RSA mATX (eBay special)

CPU: Intel Xeon E5-2680 v4 @ 2.4GHz

Memory: 64GB (2x32GB) Dataram ECC DDR4

Graphics Card: NVIDIA Quadro P2000

Boot: Kingston NV3 1TB M.2

PSU: Corsair CX550

Case: Fractal Design Core 1000

OS: Proxmox Virtual Environment

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Watch: Google Pixel Watch

 

Headphones: SteelSeries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

 

Car: 2010 Mazda 3 Takuya - 1.6L Petrol 103bhp

Link to post
Share on other sites

9 hours ago, Stentorian said:

I am aware of the alternatives such as Git and I use GitHub for a majority of my projects.

Can you configure Google drive to exclude files/directories? If so, you'd probably want to exclude everything that's also excluded in the .gitignore file.

 

Alternatively you could create a Git repo on a private server (local or remote) and use that as a backup. Or alternatively compress the source code, then put the .zip on Google drive. Could probably be scripted to automate it to some level.

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

8 hours ago, Eigenvektor said:

Can you configure Google drive to exclude files/directories? If so, you'd probably want to exclude everything that's also excluded in the .gitignore file.

 

Alternatively you could create a Git repo on a private server (local or remote) and use that as a backup. Or alternatively compress the source code, then put the .zip on Google drive. Could probably be scripted to automate it to some level.

This is the issue. They used to have that as a feature, but then removed the ability to exclude certain folders. I kind of wish they'd incorporate something like a .gitignore file for Google Drive, but it's Google and asking for something like that is like asking a bank for free money. 

 

I will have a look at the automated .zip solution. Thanks for your help!

PC: 

Spoiler

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P3 2TB M.2

SSD: Crucial BX500 1TB SSD

SSD: Crucial P2 500GB M.2

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

"Server": 

Spoiler

Motherboard: X99 RSA mATX (eBay special)

CPU: Intel Xeon E5-2680 v4 @ 2.4GHz

Memory: 64GB (2x32GB) Dataram ECC DDR4

Graphics Card: NVIDIA Quadro P2000

Boot: Kingston NV3 1TB M.2

PSU: Corsair CX550

Case: Fractal Design Core 1000

OS: Proxmox Virtual Environment

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Watch: Google Pixel Watch

 

Headphones: SteelSeries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

 

Car: 2010 Mazda 3 Takuya - 1.6L Petrol 103bhp

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×