1

I created new project in https://console.developers.google.com . Cloned one project from git, then issued command:

curl https://sdk.cloud.google.com | bash 

and

gcloud init

after doing this I'm no longer able to call

npm install

command, because cloud shell throws error

bash: npm: command not found

how can I revert (repair) Cloud shell to its primary state.

I even can't make Node.js example projects...


also

 node -v

returns

 bash: node: command not found
Benas
  • 2,106
  • 2
  • 39
  • 66
  • 1
    edit your post to include output from `echo PATH="$PATH"`. You probably just need to reset your PATH to include dirs for node and npm. Good luck. – shellter Nov 11 '15 at 23:12
  • 1
    Hold on, is this on Cloud Shell? Cloud Shell already has gcloud installed, you shouldn't have to install it! – Sandeep Dinesh Nov 11 '15 at 23:20
  • @shellter it output: PATH=/home/benas/ls/google-cloud-sdk/bin:/google/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games I fixed "npm: command not found" by reinstalling Node.js: curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs then sudo apt-get install -y build-essential it's hard to read this way, so I will post it as an answer – Benas Nov 11 '15 at 23:33
  • by the way, thank you for helping me. @Sandeep Dinesh yes I should't had to install gcloud one more time... :) – Benas Nov 11 '15 at 23:39
  • 1
    You're welcome. That's why we're here at S.O. BUT I think @SandeepDinesh is onto something about gcloud. I would run another test, and eliminate you call to `gcloud init`. Good luck. – shellter Nov 11 '15 at 23:48

1 Answers1

1

I reinstalled node.

At first I removed this dir:

 rm -rf /usr/local/lib/node_modules

then used these commands, since VM OS is Linux:

 curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
 sudo apt-get install -y nodejs

finally:

 sudo apt-get install -y build-essential

instructions are taken from

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions


now echo PATH="$PATH" outputs:

 PATH=/home/benas/ls/google-cloud-sdk/bin:/google/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

after all I decided to delete my google account and start everything from scratch, that is I created new account which had poperly working developer console.

Benas
  • 2,106
  • 2
  • 39
  • 66