.claspignore fails **/node_modules/**
See original GitHub issueExpected Behavior
**/node_modules/**
**/**
Ignores all files in node_modules .
Actual Behavior
follow-redirects options { protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: '/v1/projects/SCRUBBED/content',
method: 'put',
headers:
{ Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json;charset=utf-8',
Authorization: 'Bearer SCRUBBED',
'User-Agent': 'google-api-nodejs-client/1.3.1',
'Content-Length': 3879 },
agent: undefined,
auth: undefined,
hostname: 'script.googleapis.com',
port: null,
nativeProtocols:
{ 'http:':
{ _connectionListener: [Function: connectionListener],
METHODS: [Array],
STATUS_CODES: [Object],
Agent: [Object],
ClientRequest: [Object],
globalAgent: [Object],
IncomingMessage: [Object],
OutgoingMessage: [Object],
Server: [Object],
ServerResponse: [Object],
createServer: [Function: createServer],
get: [Function: get],
request: [Function: request] },
'https:':
{ Server: [Object],
createServer: [Function: createServer],
globalAgent: [Object],
Agent: [Object],
request: [Function: request],
get: [Function: get] } } } +0ms
Push failed. Errors:
Invalid value at 'files[2].type' (TYPE_ENUM), "D"
node_modules/fsevents/build/Release/.deps/Release/.node.d
Is getting picked up with the following error.
Added logging to clasp produces:
{ name: 'node_modules/fsevents/build/Release/.deps/Release/.node.d' }
{ name: 'node_modules/fsevents/build/Release/.deps/Release/.node',
type: 'D',
....}
from adding:
if (getAPIFileType(name) && !anymatch(ignorePatterns, name)) {
nonIgnoredFilePaths.push(name);
var file = {
name: formattedName,
type: getAPIFileType(name),
source: contents[i] //the file contents
};
console.log({name});
console.log(file);
return file;
}
Only ignore which did work:
node_modules/**
node_modules/fsevents/build/Release/.deps/Release/.node.d
**/**
Specifications
- Node version (
node -v
) : v8.9.4 - Version (
npm list | grep clasp
): “@google/clasp@1.1.5” - OS (Mac/Linux/Windows): MAC
Maybe you guys should update or drop anymatch?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:23 (11 by maintainers)
Top Results From Across the Web
@google/clasp - npm
Start using @google/clasp in your project by running `npm i @google/clasp`. There are 4 other projects in the npm registry using @google/clasp.
Read more >How to Write Google Apps Script Code Locally in VS Code ...
Important note: as Google Apps Script doesn't currently support node modules, if you include the import 'google-apps-script'; line in the files ...
Read more >How to force tsc to ignore node_modules folder?
\tsconfig.json < node_modules/@types/node/index.d.ts(6208,55): error ...
Read more >Google CLASP (Command Line Apps Script Project) NEW TOOL
Apps Script: Google CLASP (Command Line Apps Script Project) NEW TOOL ... CLASP Web App, Google Apps Script, Parcel JS, Nodemon, Node JS...
Read more >CLASP Web App, Google Apps Script, Parcel JS ... - YouTube
In this tutorial we'll use CLASP with many other tools like Parcel JS bundler, Nodemon, Node JS and setup a Web App Google...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also, you can put all the files you do want to push in a folder (eg,
src/
orGAS/
) and then add a line in your.clasp.json
file, specifying which folder to push.That works pretty well for me, as an alternative to using .claspignore.
For the
node_modules
case I found success by adding the following three lines to.claspignore
:That said, the
.claspignore
syntax should be made compatible with.gitignore
as much as possible.