Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clasp not installed? #5

Closed
gerboland opened this issue Jul 20, 2020 · 5 comments
Closed

Clasp not installed? #5

gerboland opened this issue Jul 20, 2020 · 5 comments

Comments

@gerboland
Copy link

gerboland commented Jul 20, 2020

Hey, I wanted to test this but hit a wall with the detection of clasp

~/vue-cli-plugin-gas-test $ npm -g install @google/clasp 
/usr/local/bin/clasp -> /usr/local/lib/node_modules/@google/clasp/src/index.js
npm WARN inquirer-autocomplete-prompt@1.0.1 requires a peer of inquirer@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.

+ @google/clasp@2.3.0
updated 1 package in 7.356s
~/vue-cli-plugin-gas-test $ clasp --version
2.3.0
 
~/vue-cli-plugin-gas-test $ vue add @ijusplab/vue-cli-plugin-gas

📦  Installing @ijusplab/vue-cli-plugin-gas...

+ @ijusplab/vue-cli-plugin-gas@2.0.4
updated 1 package and audited 1277 packages in 13.668s

48 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

✔  Successfully installed plugin: @ijusplab/vue-cli-plugin-gas

? Select locale English
? Create new script? Yes
? Select script type standalone
? Select a region UCT
? Select a timezone UCT
? Add license? No

🚀  Invoking generator for @ijusplab/vue-cli-plugin-gas...
📝 Changing files...
 GAS-PLUGIN 	File not found .env. Had to create it.
⠋  Running completion hooks...Error: Cannot find module '@google/clasp/package.json'
Require stack:
- /Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js
- /Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/generator/index.js
- /Users/gerry/vue-cli-plugin-gas-test/package.json
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
    at Function.resolve (internal/modules/cjs/helpers.js:81:19)
    at isInstalled (/Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:53:33)
    at checkVersion (/Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:117:17)
    at setup (/Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:166:3)
    at Installer.setup (/Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:179:24)
    at /Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/generator/index.js:49:27
    at runGenerator (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:132:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async invoke (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:92:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js',
    '/Users/gerry/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/generator/index.js',
    '/Users/gerry/vue-cli-plugin-gas-test/package.json'
  ]
}
⚓  Running completion hooks...
 ERROR  Error: Clasp not installed
Error: Clasp not installed
    at checkVersion (/Users/gerry/dev/donutz/app-script/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:118:23)
    at setup (/Users/gerry/dev/donutz/app-script/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:166:3)
    at Installer.setup (/Users/gerry/dev/donutz/app-script/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/utils/claspHelpers.js:179:24)
    at /Users/gerry/dev/donutz/app-script/vue-cli-plugin-gas-test/node_modules/@ijusplab/vue-cli-plugin-gas/generator/index.js:49:27
    at runGenerator (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:132:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async invoke (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:92:3)

I'm using OS X Cataline 10.15.5, and have been using GAS and clasp for some time.

I do have /usr/local/lib/node_modules/@google/clasp/package.json but perhaps my search path is bad? Help appreciated

@gerboland
Copy link
Author

Hmm NODE_PATH=/usr/local/lib/node_modules vue add @ijusplab/vue-cli-plugin-gas worked. I thought that was the default...

@cmlima cmlima closed this as completed Jul 25, 2020
@barecool
Copy link
Contributor

barecool commented Aug 6, 2020

for me it didnt work unless i installed clasp locally to the dev dependencies... i have clasp 2.3.0 installed globally and it did not detect it.

@cmlima
Copy link
Contributor

cmlima commented Aug 6, 2020

Have you got the error output?

@barecool
Copy link
Contributor

same as above except im on windows 10, if i install clasp as a dependency it works fine.

@cmlima
Copy link
Contributor

cmlima commented Aug 23, 2020

Ok, thanks @barecool. The issue you and @gerboland experienced seems to be related to the isInstalled function in the claspHelpers.js file, particularly to the command require.resolve('@google/clasp/package.json').

In my case, I tested it directly in node shell. When I ran the command I got a path inside my global node modules (under /Users/cmlima/node_modules), as expected.

Regardless, I will update the README file in order to instruct other developers about installing clasp locally in case they get the same error message you did. Since I was not able to reproduce your issue, I am afraid I will not be able to do much more for now. Any help will be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants