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

t2: command not found #1386

Open
TAMHAN opened this issue Dec 8, 2017 · 14 comments
Open

t2: command not found #1386

TAMHAN opened this issue Dec 8, 2017 · 14 comments

Comments

@TAMHAN
Copy link

TAMHAN commented Dec 8, 2017

Hello Folks,
sitting here on Ubuntu 14.04, with Node.JS 6.10, and cannot install Tessel CLI. The NPM installation process runs, but does not create the t2 binary:

tamhan@TAMHAN14:~$ sudo npm -g install t2-cli
. . .

npm ERR! Linux 4.4.0-101-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "install" "t2-cli"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! path /home/tamhan/.npm-packages/lib/node_modules/t2-cli
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access

npm ERR! enoent ENOENT: no such file or directory, access '/home/tamhan/.npm-packages/lib/node_modules/t2-cli'
npm ERR! enoent ENOENT: no such file or directory, access '/home/tamhan/.npm-packages/lib/node_modules/t2-cli'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! /home/tamhan/npm-debug.log
tamhan@TAMHAN14:~$

tamhan@TAMHAN14:$ rm /home/tamhan/.npm-packages/lib/node_modules/t2-cli
tamhan@TAMHAN14:
$ mkdir /home/tamhan/.npm-packages/lib/node_modules/t2-cli
tamhan@TAMHAN14:$ sudo npm -g install t2-cli
tamhan@TAMHAN14:
$ t2
t2: command not found

tamhan@TAMHAN14:~$ sudo npm -g install t2-cli
/home/tamhan/.npm-packages/bin/t2 -> /home/tamhan/.npm-packages/lib/node_modules/t2-cli/bin/tessel-2.js
/home/tamhan/.npm-packages/bin/cargo-tessel -> /home/tamhan/.npm-packages/lib/node_modules/t2-cli/bin/cargo-tessel.js

t2-cli@0.1.17 postinstall /home/tamhan/.npm-packages/lib/node_modules/t2-cli
t2 install drivers --loglevel=error || true; t2 install homedir --loglevel=error || true;

sh: 1: t2: not found
sh: 1: t2: not found
/home/tamhan/.npm-packages/lib
└── t2-cli@0.1.17

tamhan@TAMHAN14:~$

Furthermore, here is the log for the failed installation:
...
14928 silly generateActionsToTake Starting
14929 silly install generateActionsToTake
14930 warn checkPermissions Missing write access to /home/tamhan/.npm-packages/lib/node_modules/t2-cli
14931 silly rollbackFailedOptional Starting
14932 silly rollbackFailedOptional Finishing
14933 silly runTopLevelLifecycles Finishing
14934 silly install printInstalled
14935 verbose stack Error: ENOENT: no such file or directory, access '/home/tamhan/.npm-packages/lib/node_modules/t2-cli'
14935 verbose stack at Error (native)
14936 verbose cwd /home/tamhan
14937 error Linux 4.4.0-101-generic
14938 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "install" "t2-cli"
14939 error node v6.10.3
14940 error npm v3.10.10
14941 error path /home/tamhan/.npm-packages/lib/node_modules/t2-cli
14942 error code ENOENT
14943 error errno -2
14944 error syscall access
14945 error enoent ENOENT: no such file or directory, access '/home/tamhan/.npm-packages/lib/node_modules/t2-cli'
14946 error enoent ENOENT: no such file or directory, access '/home/tamhan/.npm-packages/lib/node_modules/t2-cli'
14946 error enoent This is most likely not a problem with npm itself
14946 error enoent and is related to npm not being able to find a file.
14947 verbose exit [ -2, true ]

@newcasio
Copy link

newcasio commented Jan 8, 2019

I'm getting this too.

t2/t2 list commands say t2: command not found

My npm install -g t2-cli is slightly different with
sh: t2: command not found
sh: t2: command not found
+ t2-cli@0.1.22

@HipsterBrown
Copy link
Contributor

@TAMHAN @newcasio after looking at a similar issue (#1085), can you try running sudo /home/tamhan/.npm-global/bin/t2 install drivers or sudo /home/tamhan/.npm-packages/lib/node_modules/t2-cli/bin/tessel-2.js install drivers?

@newcasio
Copy link

newcasio commented Jan 8, 2019

@HipsterBrown I have tried both commands. The first one returns
INFO No driver installation necessary.
The second returns a message Users/daniththai/.npm-packages/lib/node_modules/t2-cli/bin/tessel-2.js: command not found.
I am new to programming so I have copied your command character for character.
Thanks for trying to resolve this.

@HipsterBrown
Copy link
Contributor

@newcasio Are you on Linux or another OS? What version of Node and npm are you using?

@newcasio
Copy link

newcasio commented Jan 8, 2019

@HipsterBrown Mac OS.
Node version 11.6.0.
npm version 6.5.0-next.0.

@HipsterBrown
Copy link
Contributor

Ok if you uninstall t2-cli (npm uninstall -g t2-cli) and re-install it (npm install -g t2-cli), what is the output in your terminal?

@newcasio
Copy link

newcasio commented Jan 8, 2019

Sorry about the formatting but this is the output.

npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
/Users/daniththai/.npm-global/bin/t2 -> /Users/daniththai/.npm-global/lib/node_modules/t2-cli/bin/tessel-2.js
/Users/daniththai/.npm-global/bin/cargo-tessel -> /Users/daniththai/.npm-global/lib/node_modules/t2-cli/bin/cargo-tessel.js

> usb@1.5.0 install /Users/daniththai/.npm-global/lib/node_modules/t2-cli/node_modules/usb
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
[usb] Success: "/Users/daniththai/.npm-global/lib/node_modules/t2-cli/node_modules/usb/src/binding/usb_bindings.node" is installed via remote

> t2-cli@0.1.22 postinstall /Users/daniththai/.npm-global/lib/node_modules/t2-cli
> t2 install drivers --loglevel=error || true; t2 install homedir --loglevel=error || true;

sh: t2: command not found
sh: t2: command not found
+ t2-cli@0.1.22
added 707 packages from 972 contributors in 21.498s

@HipsterBrown
Copy link
Contributor

It appears to be installing correctly. What does which t2 output?

@newcasio
Copy link

newcasio commented Jan 8, 2019

No output. It just goes to the next command line.

danith-thais-imac:tessel daniththai$ which t2
danith-thais-imac:tessel daniththai$

@HipsterBrown
Copy link
Contributor

Ok I think I might know the issue. I don't think your terminal PATH is set up to look under ~/.npm-global/bin for globally installed packages. You can confirm that by running echo $PATH and looking for .npm-global in the output.

If you have a ~/.bashrc or ~/.bash_profile, put the following line in there, save it, start a new terminal session, and try running which t2 again.

export PATH=~/.npm-global/bin:$PATH

@newcasio
Copy link

newcasio commented Jan 8, 2019

I did originally have the EACCES issue that is mentioned on the Tessel installation page and followed the directions on the npmjs page which includes running the export PATH=~/.npm-global/bin:$PATH command.

When running echo $PATH in the ~/.npm-global/bin folder I don't see .npm-global.
Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mongodb/bin:/Users/daniththai/.rvm/bin

@TAMHAN
Copy link
Author

TAMHAN commented Jan 8, 2019

Hello,
even though I havent used Tessel at all since this bug report, here is the content of PATH on my workstation as of today:
tamhan@TAMHAN14:~$ echo $PATH
/home/tamhan/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/opt/microchip/xc8/v1.38/bin:/opt/microchip/xc8/v1.38/bin:/home/tamhan/.npm-packages/bin

Please be careful as it probably has changed since when I used tessel last.

Tam, just trying to be a good citizen

@HipsterBrown
Copy link
Contributor

@newcasio ~/.npm-global/bin needs to be in your PATH to use any globally installed package from npm. You need that export PATH=~/.npm-global/bin:$PATH command to be run whenever you start a new terminal session, so it needs to be in your ~/.bash_profile file.

@newcasio
Copy link

@HipsterBrown Thankyou very much for your help. I went missing for a little bit there, but have comeback to try with your suggestion, and all is working now.
Cheers.

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