vendredi 2 novembre 2018

ubuntu 18.04- ember: command not found

I know this has been addressed before, but I've tried the advice on No command 'ember' found and it hasn't worked for me.

I'm trying to install EmberJs for a techtest and I keep getting 'Command 'ember' not found'. I'm on Ubuntu 18.04, and have checked all my paths as follows.

When I run npm install -g ember-cli it installs and shows:

npm WARN deprecated exists-sync@0.0.4: Please replace with usage of 
fs.existsSync
/home/[user]/.npm-global/bin/ember -> 
/home/[user]/.npm-global/lib/node_modules/ember-cli/bin/ember
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 
(node_modules/ember-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"linux","arch":"x64"})
+ ember-cli@3.5.0
updated 1 package in 14.662s

So I've definitely got it installed. When I run which npm/ which node I get the following respectively:

/usr/bin/npm
/usr/bin/node

When I run echo $PATH I get:

/home/[user]/npm_global/bin:/usr/local/share/npm/bin:
/usr/local/bin:/usr/local/sbin:~/bin:/usr/share/rvm/gems/ruby-2.3.7/
bin:/usr/share/rvm/gems/ruby-2.3.7@global/bin:/usr/share/rvm/rubies/
ruby-2.3.7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/
sbin:/bin:/usr/games:/usr/local/games:/usr/bin:/snap/bin:/usr/
share/rvm/bin

Andddd I have these paths in my bashrc:

export PATH="/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:~/bin:$PATH"

and

export PATH="/home/[user]/npm_global/bin:$PATH"

I realise this is a lot of info, I'm new to this so wanted to give as much as I could. Any suggestions very much appreciated, thank you!




1 commentaire:

  1. mkdir ~/.npm-global
    npm config set prefix '~/.npm-global'
    echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
    source ~/.profile

    Check this article
    https://www.samclarke.com/setup-node-ubuntu-18-04/

    RépondreSupprimer