google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.53k stars 423 forks source link

Google Cloud Shell: since @google/clasp v2.4.0 "clasp push -w" crashes #914

Closed JShinigami closed 10 months ago

JShinigami commented 2 years ago

DOES WORK: npm i @google/clasp@2.3.1 -g clasp push -w

DOES NOT WORK: npm i @google/clasp -g clasp push -w

ERROR /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@google/clasp/build/src/index.js:2 import why from 'wtfnode'; // should be your first require ^^^^^^

SyntaxError: Cannot use import statement outside a module at Module._compile (internal/modules/cjs/loader.js:891:18) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11

SPECIFICATIONS Google Cloud Shell, bash terminal NPM v8.5.0 Node v12.14.1

bdetry commented 2 years ago

Same issue any update?

I cannot event do a clasp version

bdetry commented 2 years ago

Updating to the lastested node version solved the issue.

I updated from 10 to 14.

Google docs says its wotk from node version 4.

Please update

JShinigami commented 2 years ago

My cloud shell currently uses node v16.4.0 which seems to be the latest LTS version.

Now there is a new error when using the following commands:

npm i @google/clasp -g
clasp push -w

Error: drive.google.com ✖ Error: Looks like you are offline.

JShinigami commented 10 months ago

Seems to be fixed in the meantime.