Trying to run truffle and it says command not found on my mac - npm-install

I've been trying to start Truffle but when I do $ truffle it says command not found. I've done npm init, npm i truffle and ./node_modules/.bin/truffle init but nothing works. I have the latest version of node but it still makes no difference.
Roberts-MacBook-Pro-9:~ rbeit$ truffle init
-bash: truffle: command not found
Roberts-MacBook-Pro-9:~ rbeit$ truffle
-bash: truffle: command not found
Roberts-MacBook-Pro-9:~ rbeit$

You have only installed the truffle npm locally, you can ether install it globally with npm install -g truffle or call it from npm by adding
"scripts": {
"truffle": "truffle init",
}
to your package.json
and call it like this npm run truffle

Related

dependancies not found error after running command npm run serve in vue

I have cloned one of my vue project from git to my another laptop. I have ran npm install.
But after running npm run serve I am getting the following error -
These dependencies were not found:
* core-js/modules/es.error.cause.js in ./node_modules/#babel/runtime/helpers/esm/regeneratorRuntime.js
* core-js/modules/es.error.to-string.js in ./node_modules/#babel/runtime/helpers/esm/regeneratorRuntime.js
To install them, you can run: npm install --save core-js/modules/es.error.cause.js core-js/modules/es.error.to-string.js
Why is this occuring ?
Note : I have run npm install --save core-js. But didnt work.

I am finding it difficult to initialize package.json file in my truffle project

I can not install package.json dependencies in my truffle project and I have tried touch.json. it's giving me errors. I have also tried truffle init, but it is not working.
to install package.json dependencies you have to type npm install or npm i

How to fix "npm ERR! Unexpected end of JSON input while parsing" on Vue CLI installation

I want to install Vue CLI . and i run this on my Git Bash .
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
but having error like this :
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
npm ERR! Unexpected end of JSON input while parsing near '...ery":"latest","throug'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ECLIPSE\AppData\Roaming\npm-cache\_logs\2019-10-09T02_48_52_427Z-debug.log
i try with solution in stackoverflow in this thread here
. i try with
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~/Desktop
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
but i try to install again , its have same error . someone can help me about this ?
I had a very similar problem and simple npm cache clean --force command did not help too.
I solved the problem by deleting C:\Users\User\AppData\Roaming\npm and C:\Users\User\AppData\Roaming\npm-cache directories and running an npm cache clean --force command after this. Then, npm install worked properly.
If the problem continues to appear, reinstall Node.js and NPM. Do not forget to check if all previous files connected with them are deleted before the installation!
This process work for me
1 - Run your Command Invite/Terminal as Administrator
2 - Install the Vue CLI globally with the command :
npm install -g vue-cli

Gatsby : -bash: gatsby: command not found after npm install

When I try to install gatsby running npm install gatsby-cli -g , it does not work : when I run gatsby --help, it shows:
bash:gatsby command not found
I have tried:
uninstalling and reinstalling NPM
this gitHub solution : https://github.com/gatsbyjs/gatsby/issues/4967
I get a permission error when trying to change npm config set prefix /usr/local
I'm working on mac (version 10.14.5).
My environment details are as follows:
npm -v : 6.9.0
node -v : v10.16.0
What can I do to make it work?
Thanks in advance,
If it's a permissions error, you could use sudo npm install gatsby-cli -g to run it as a superuser. I have to do this when I install something globally.

Typescript npm install not working

When I run sudo npm install -g typescript the only thing that gets installed is test3. This is what I get:
$ sudo npm install -g typescript
Password:
test3#1.0.0 /usr/local/lib/node_modules/test3
$ tsc
-bash: tsc: command not found
The Typescript compiler is never installed. I reinstalled node/npm just now to see if it was an install issue, but that didn't seem to fix it. Any ideas?