Quand j'ai essayé d'exécuter npm run dev
dans mon projet nuxt, ma console a renvoyé ce message:
'nuxt' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Installez globalement cross-env: npm install -g cross-env
Mettez ensuite à jour les scripts package.json pour commencer par "cross-env ...."
exemple:
"scripts": {
"dev": "cross-env nuxt",
"build": "cross-env nuxt build",
"start": "cross-env nuxt start",
"generate": "cross-env nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
},
Cela fonctionne sur mon Windows 10.