'NPM Spaces in Path causes Google Drive errors Windows
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
If the log file is relevant, please let me know and I will upload it.
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!
Solution 1:[1]
So whilst not a direct solution the problem, it is one that I have come to start using as I cannot find a fix to this problem.
I am now running my projects locally from my Documents folder, using Git/GitHub for saving changes (making use of branches), and a script that periodically compresses my coding folder (excluding node_modules) and saves it to the G:/ drive (Google Drive).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bwhybrow23 |
