Skip to content

Commit

Permalink
Add 'remove clasp' in setup instructions
Browse files Browse the repository at this point in the history
Not removing the current version of `clasp` can break `node_module` dependencies. It's better to start with a clean version of clasp.

Here's my history:

```
sudo npm run build;

> @google/[email protected] build /Users/timmerman/Documents/github/google/clasp
> tsc --project tsconfig.json; npm i -g;

index.ts(200,17): error TS7006: Parameter 'answers' implicitly has an 'any' type.
index.ts(202,17): error TS7006: Parameter 'err' implicitly has an 'any' type.
index.ts(297,17): error TS7034: Variable 'fileIds' implicitly has type 'any[]' in some locations where its type cannot be determined.
index.ts(300,15): error TS7005: Variable 'fileIds' implicitly has an 'any[]' type.
index.ts(306,25): error TS7005: Variable 'fileIds' implicitly has an 'any[]' type.
index.ts(307,23): error TS7006: Parameter 'answers' implicitly has an 'any' type.
index.ts(312,23): error TS7006: Parameter 'err' implicitly has an 'any' type.
index.ts(714,25): error TS7017: Element implicitly has an 'any' type because type '{ textPayload: any; jsonPayload: any; protoPayload: any; }' has no index signature.
index.ts(720,31): error TS7017: Element implicitly has an 'any' type because type '{ ERROR: any; INFO: any; DEBUG: any; NOTICE: any; }' has no index signature.
index.ts(745,55): error TS7006: Parameter 'err' implicitly has an 'any' type.
index.ts(762,12): error TS7006: Parameter 'functionName' implicitly has an 'any' type.
src/auth.ts(63,55): error TS2339: Property 'port' does not exist on type 'string | AddressInfo'.
  Property 'port' does not exist on type 'string'.
npm ERR! path /usr/local/lib/node_modules/.staging/@google/clasp-e2305ebe/node_modules/@google-cloud/common
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/@google/clasp-e2305ebe/node_modules/@google-cloud/common' -> '/usr/local/lib/node_modules/.staging/@google-cloud/common-0995f8ca'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/root/.npm/_logs/2018-05-25T16_33_27_616Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 254
npm ERR! @google/[email protected] build: `tsc --project tsconfig.json; npm i -g;`
npm ERR! Exit status 254
npm ERR!
npm ERR! Failed at the @google/[email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/root/.npm/_logs/2018-05-25T16_33_27_662Z-debug.log
```

```
sudo npm uninstall -g @google/clasp
removed 594 packages in 5.063s
```

```
sudo npm run build;

> @google/[email protected] build /Users/timmerman/Documents/github/google/clasp
> tsc --project tsconfig.json; npm i -g;

index.ts(200,17): error TS7006: Parameter 'answers' implicitly has an 'any' type.
index.ts(202,17): error TS7006: Parameter 'err' implicitly has an 'any' type.
index.ts(297,17): error TS7034: Variable 'fileIds' implicitly has type 'any[]' in some locations where its type cannot be determined.
index.ts(300,15): error TS7005: Variable 'fileIds' implicitly has an 'any[]' type.
index.ts(306,25): error TS7005: Variable 'fileIds' implicitly has an 'any[]' type.
index.ts(307,23): error TS7006: Parameter 'answers' implicitly has an 'any' type.
index.ts(312,23): error TS7006: Parameter 'err' implicitly has an 'any' type.
index.ts(714,25): error TS7017: Element implicitly has an 'any' type because type '{ textPayload: any; jsonPayload: any; protoPayload: any; }' has no index signature.
index.ts(720,31): error TS7017: Element implicitly has an 'any' type because type '{ ERROR: any; INFO: any; DEBUG: any; NOTICE: any; }' has no index signature.
index.ts(745,55): error TS7006: Parameter 'err' implicitly has an 'any' type.
index.ts(762,12): error TS7006: Parameter 'functionName' implicitly has an 'any' type.
src/auth.ts(63,55): error TS2339: Property 'port' does not exist on type 'string | AddressInfo'.
  Property 'port' does not exist on type 'string'.
/usr/local/bin/clasp -> /usr/local/lib/node_modules/@google/clasp/index.js
+ @google/[email protected]
added 1 package from 1 contributor in 2.725s
```

Observe clasp builds successfully without `npm ERR!`.
  • Loading branch information
grant authored May 25, 2018
1 parent b40f4d2 commit 7f35583
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ Use an IDE like **Visual Studio Code** for TypeScript autocompletion.

### Setup

Install `tsc`: `npm install -g typescript`
- Install `tsc`: `npm install -g typescript`
- Remove your local version of `clasp`: `sudo npm uninstall -g @google/clasp`
- This will prevent errors when updating `node_modules`.

#### After Making a Change

Expand Down

1 comment on commit 7f35583

@grant
Copy link
Contributor Author

@grant grant commented on 7f35583 May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this help will stop build errors.
I also had to sudo rm -rf node_modules/.
FYI @campionfellin.

Please sign in to comment.