Friday 9 June 2017

cross-env issue when running "npm run dev" for vue-cli

I'm with Centos7, installed on VirtualBox (true OS: Windows 7).

  • Node version: 6.10.3
  • Npm version: 3.10.10

I installed vue-cli, like this:

sudo npm install -g vue-cli

Then I created a new vue project, like this:

sudo vue init webpack-simple mynewproject

But I get an error when running:

> mynewproject@1.0.0 dev /var/www/html/mynewproject
> cross-env NODE_ENV=development webpack-dev-server --open --hot

sh: cross-env : commande introuvable

npm ERR! Linux 3.10.0-514.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! vuetest@1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the mynewproject@1.0.0 dev script 'cross-env NODE_ENV=development webpack-dev-server --open --hot'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vuetest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vuetest
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vuetest
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/mynewproject/npm-debug.log

Does anyone know how to fix it?



via Baptiste

No comments:

Post a Comment