Tag Archives: npm

[Solved] NPM Awalys Error: unable to verify the first certificate

Today, NPM install always reports an error: unable to verify the first certificate. After checking, it is found that

As of February 27, 2014, npm no longer supports its self-signed certificates. 

On February 27, 2014, NPM no longer supported self signed certificates

Because NPM install follows the HTTPS protocol, it needs to be guaranteed by digital certificates

Solution 1:

Cancel SSL validation: NPM config set strict SSL false

If not, replace the NPM source with a domestic image:
NPM config set registry   http://registry.cnpmjs.org/
npm config set registry   http://registry.npm.taobao.org/

Solution 2:

Upgrade: NPM install NPM – G — Ca = null
or NPM config set CA = “”

Recommended usage 1

 

NPM Install gulp-sass error: checking for Python executable “python2” in the PATH

An error was reported when installing gulp sass today: checking for Python executable “python2” in the path

Try a lot of methods, and finally use cnpm to install it successfully

Specific methods:

1. Install cnpm

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

2. Install gulp sass

The syntax is the same, just change NPM to cnpm

cnpm install –save-dev gulp-sass

It’s done

Eperm: operation not permitted, unlink

Recently, I was working on an e-commerce operation background management system. After pulling, I tried to install the wheel imported and exported from excel, which I had built in NPM before. The error message was as follows:

after all kinds of Baidu, I finally found out the reason. It turned out that my NPM was foreign, and I didn’t switch to the domestic Taobao image, resulting in slow download and packet loss

Solutions

1. First, delete the node_ Modules file
there are two ways: 1. Delete directly in the folder; 2; ②rm -r node_ Delete modules command line
2. Clear NPM cache: NPM cache clean — force
3. After switching the image, NPMI can install all the files

If the above solution still can’t be solved, restart vscode, and my plan is to restart the automatic update

npm Module build failed: Error: No PostCSS Config found in:

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Module build failed: error: no postcss config found in: NPM

The solution you are looking for on the Internet should mention the problem of the webpack version. Don’t think that when you upgrade the webpack version, some modules can’t keep up with the pace of upgrade, or they may not be updated, which leads to you upgrading the webpack and can’t find the configuration of postcss<
at present, the configuration of postcss found on NPM is webpack.config.js,
postcss.config.js is a special processing for webpack 3.0

Scene

I use Vue cli to create a project, and then if I want to change places, I just add node_ All files other than modules are copied to another file, and then transferred to GIT. You can re NPM run dev as you want. However, it can be displayed normally in the original location, but in the new file, it will report an error module build failed: error: no postcss config found in:/users/* * , which is very embarrassing

Solution

I checked the information on the Internet and said:

You need to create a new file postcss. Config. JS in the root file and add the following code:

module.exports = { 
  plugins: { 
    'autoprefixer': {browsers: 'last 5 version'} } }

1

2

3

4

5

then npm run dev.

NPM install socket.io[UNK][UNK] error: [UNK](npm WARN enoent ENOENT: no such file or directory, open ‘/usr/local/no…

25191e;-e.g. install socket.io35013;- 25253;- 381691;p>

[root@WEB node_modules]#npm install socket.io
npm WARN enoent ENOENT: no such file or directory, open '/usr/local/nodejs/bin/package.json'
npm WARN bin No description
npm WARN bin No repository field.
npm WARN bin No README data
npm WARN bin No license field.

npm ERR! path /usr/local/nodejs/bin/node_modules/.staging/socket.io-901b0797/node_modules/socket.io-client
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/nodejs/bin/node_modules/.staging/socket.io-901b0797/node_modules/socket.io-client' -> '/usr/local/nodejs/bin/node_modules/.staging/socket.io-client-cf016aaa'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-25T09_40_26_701Z-debug.log

Solution:

On the command line, enter:

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist

Then enter NPM install – G socket.io to install it correctly