Tag Archives: NPM run dev Error

npm run dev Error: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]

npm run dev Error: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]

report errors:

Solution:

Method 1: Replace the scripts part in package.json:

 "scripts": {
    "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
    "lint": "eslint --ext .js,.vue src",
    "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "build:stage": "vue-cli-service build --mode staging",
    "preview": "node build/index.js --preview",
    "new": "plop",
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
    "test:unit": "jest --clearCache && vue-cli-service test:unit",
    "test:ci": "npm run lint && npm run test:unit"
  }

Method 2: reduce the node version

How to Solve NPM run dev error: missing script:dev

When running the Vue project today, an error was reported when running npm run dev as shown below:

Open the package.js folder and find that the scripts in the folder have dev as shown below:

,

But I can’t find it. What is the reason? The last time I saw that the path was wrong, when vue init webpack my-project, I created a folder by myself, and I couldn’t get the dev in the corresponding package.js.

cd to the corresponding folder, re-run npm run dev and it will be OK .

And the scripts in package.js do not have dev, in this case 

Enter vue init webpack to download the missing package.json again:

   “dev”: “webpack-dev-server –inline –progress –config build/webpack.dev.conf.js”,
    “start”: “npm run dev”,
    “build”: “node build/build. js”

 Then install dependencies in npm intall, and finally npm run dev

Also suitable for solving start, build loss

NPM run dev Error Module build failed: Error: Cannot find module ‘node-sass’

For a project, you may pull it from another library, change a computer, or for other reasons, you need to re install the dependency environment,

Sometimes the node sass installation fails. This phenomenon is too normal, for example:

Don’t panic when you report an error. You can usually find the answer by reading the beginning of the error report. He said that he didn’t find the module node sass

In this case, you can go to the project dependency node_ Look inside the module and find that there is no such bag. Please reload it

npm install node-sass –save

This kind of error report is coming. This node sass package should be on a foreign site. It is very easy to fail in the process of pulling. If it is broken in the middle, it will be over. So the Taobao team made an image of NPM, called cnpm. They will mirror the packages on NPM to their own site. It is relatively smooth for the domestic ones to pull the domestic ones, so you need to have the function of cnpm first, and then use cnpm to install

1.npm install -g cnpm –registry= https://registry.npm.taobao.org

2.cnpm install node-sass –save

Check the node after loading_ Modules found that the installation was successful

Run NPM run dev