0

In the vue-cli, I want to npm run dev, but get the bellow error:

$ npm run dev > [email protected] dev /Users/den/Desktop/Test/vue/vuejs-playlist > cross-env NODE_ENV=development webpack-dev-server --open --hot sh: cross-env: command not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! [email protected] dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot` npm ERR! spawn ENOENT 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. npm WARN Local package.json exists, but node_modules missing, did you mean to install? npm ERR! A complete log of this run can be found in: npm ERR! /Users/den/.npm/_logs/2018-02-02T11_54_11_067Z-debug.log 

3 Answers 3

2

Try as follows for @vue/cli

npm run serve 
Sign up to request clarification or add additional context in comments.

Comments

1

In your traceback:

Local package.json exists, but node_modules missing, did you mean to install?

You should in your project root directory install the dependencies:

npm install 

Or use its logogram npm i

Comments

0

As both answers before stated your build failed due needing to first:

npm install 

Once that is complete, check your package.json file.

In there will have the default options for npm run followed by your build script option.

Example:

{ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build" } } 

Resulting in your npm run serve is the same as vue-cli-service serve

Reference: Vue Docs

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.