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

errors with "Command not found" on OSX, Ubuntu #319

Closed
tconroy opened this issue Nov 17, 2015 · 9 comments
Closed

errors with "Command not found" on OSX, Ubuntu #319

tconroy opened this issue Nov 17, 2015 · 9 comments

Comments

@tconroy
Copy link

tconroy commented Nov 17, 2015

Hey there,

Not sure what's up since I've run webpack-dev-server in the past just fine, but currently when I try and invoke it ( either globally or locally in a project ), I'm getting the following shell error:

$ webpack-dev-server --inline --hot
zsh: command not found: 'webpack-dev-server'

I've tried:
A) uninstalling ( both locally and globally )
B) clearing NPM cache
C) re-installing ( both locally and globally )

but still receive the same error.

Further, I posted this originally as a question on StackOverflow, to which another user replied that they were encountering the exact same issue on Ubuntu.

Was a broken update recently pushed?

@tconroy tconroy changed the title errors with "Command not found" on OSX errors with "Command not found" on OSX, Ubuntu Nov 17, 2015
@flindenberg
Copy link

I'm experiencing the same on Ubuntu (using vagrant with Windows host and Ubuntu guest).

I suspected node-gyp to be the problem, because of several error messages I received earlier. However, thanks to #302, which was merged tonight, socket.io was replaced. socket.io required node-gyp. So this shouldn't be a problem any longer.

Uninstalling and reinstalling everything (including the newest version of webpack-dev-server) still results in command not found when I run $ webpack-dev-server.

Any ideas how to fix this?

@flindenberg
Copy link

I was able to solve this problem on my machine. It appears to have been an issue with permissions.

I installed webpack and webpack-dev-server globally. However, even then, $ webpack-dev-server resulted in command not found (as stated above).

The problem was that npm installed the global packages to /usr/local/lib/node_modules which required root permissions.

In order to avoid having to use root permissions, I changed the directory in which global packages are to be installed to a directory in $HOME. To do this, I followed this guide: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

I installed webpack and webpack-dev-server globally again (this time without sudo) and verified that they have been installed in my new directory.

Now, I can finally run $ webpack-dev-server.

I hope this helps @tconroy!

@zzz6519003
Copy link

thanks man!

@tconroy
Copy link
Author

tconroy commented Feb 2, 2016

Thanks for sharing your findings @flindenberg! I'll try this when I get home tonight.

@flindenberg
Copy link

You're welcome! Good luck :-)

@mneil
Copy link

mneil commented Mar 29, 2016

I had the same issue using nvm on ubuntu. Just in case anyone else runs into this.

sudo cp /home/[user]/.nvm/versions/node/[node_version]/lib/node_modules/webpack-dev-server/bin/webpack-dev-server.js /usr/local/bin/webpack-dev-server
chown [user]:[user] /usr/local/bin/webpack-dev-server
chmod +x /usr/local/bin/webpack-dev-server

Replace the content in brackets with your specific path info for user and node version.

@fengchuantao
Copy link

thanks man! @flindenberg

@kabinpokhrel
Copy link

Thanks man ! It helped

@arthursm
Copy link

Bro, Thank youuu 👍

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

8 participants