Tag Archives: npm

After NPM downloads a vuelazload, swipwe reports an error [Solved]

Question.
1. npm After downloading a VueLazyload
2, an error is reported
index.js?bed3:161 [WDS] Errors while compiling. Reload prevented.
errors @ index.js?bed3:161
index.js?bed3:167 ./node_modules/css-loader??ref–5-1!./node_modules/postcss-loader/lib??ref–5-2!./node_modules/[email protected]@swiper/css/swiper.css
Module build failed: Error: ENOENT: no such file or directory, open ‘H:\Html\ Operation script \ Mobile Xiaomi Mall\mi-shop-stu\[email protected]@swiper\css\swiper.css’
@ ./node_modules/[email protected]@swiper/css/swiper.css 4:14-119 13:3-17:5 14:22-127
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
errors @ index.js?bed3:167
index.js?bed3:167 ./node_modules/[email protected]@swiper/js/swiper.esm.bundle.js
Module build failed: Error: ENOENT: no such file or directory, open ‘H:\Html\ Operation script \ Mobile Xiaomi Mall\mi-shop-stu\[email protected]@swiper\js\swiper.esm.bundle.js’
@ ./node_modules/vue-awesome-swiper/dist/vue-awesome-swiper.js 9:80-97
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

Solution: Recompile
Errors while compiling. reLoad prevented. Reload prevented.

 

How to Solve NPM read econnreset Error

What to do when NPM reports an error like a retarded person
read econnreset
this is most likely not a problem with NPM itselft
‘proxy’ config is set properly

In this case, we generally use the IE proxy server
to run the following commands on the command line

npm config set proxy=http://10.69.4.40:808 ##Change the ip and port according to your actual situation

 

[Solved] NPM installation error: error: eacces: permission denied

Error:

sudo npm i webpack -g
/Users/xesfe/.npm-global/bin/webpack -> /Users/xesfe/.npm-global/lib/node_modules/webpack/bin/webpack.js
# System-wide .profile for sh(1)

> [email protected] install /Users/xesfe/.npm-global/lib/node_modules/webpack/node_modules/fsevents
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/xesfe/.npm-global/lib/node_modules/webpack/node_modules/fsevents/build'
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/Users/xesfe/.nvm/versions/node/v10.16.2/bin/node" "/Users/xesfe/.nvm/versions/node/v10.16.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xesfe/.npm-global/lib/node_modules/webpack/node_modules/fsevents
gyp ERR! node -v v10.16.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
updated 1 package in 22.243s

Option 1:

 npm install --unsafe-perm=true --allow-root -g nodeppt

Nodeppt is always reported as an error during installation. The problem can be solved by checking the data and adding — unsafe perm = true — allow root. Issue on git: https://github.com/npm/npm/issues/17268 , this scheme doesn’t seem so elegant, so look for the second scheme

Option 2

1. Establish global folder configuration

mkdir ~/npm-global
 
npm config set prefix '~/npm-global'

PS: don’t create a configuration file starting with dot (.) under Mac, otherwise it still can’t be solved

2. Modify environment variables

vi /etc/profile 

If the file is read-only, change the read-write permission of the file

sudo chmod 777 /etc/profile

Append in/etc/profile

# npm配置
export PATH=~/npm-global/bin:$PATH

3. Activate environment variable configuration

source /etc/profile

4. Press again

i webpack -g
/Users/xesfe/npm-config/bin/webpack -> /Users/xesfe/npm-config/lib/node_modules/webpack/bin/webpack.js

> [email protected] install /Users/xesfe/npm-config/lib/node_modules/webpack/node_modules/fsevents
> node-gyp rebuild

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
+ [email protected]

 

5. If you perform webpack discovery

zsh: command not found: webpack

Then add it to the environment variable

Do the following:

vi .bash_profile

In. Bash_Profile add

export NPM_CONFIG=~/npm-config
export PATH=$PATH:$NPM_CONFIG/bin

Execute the following command for the environment variable to take effect

source .bash_profile

 

[Solved] Error reporting of NPM packaged electron app

During desktop packaging, the following errors are encountered:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;E:\CodeSpace\SCM_TEST\desktop\node_modules\.bin;C:\Program Files\nodejs;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program\JAVA\jdk1.8.0_91\bin;C:\Program\ANT\apache-ant-1.9.7\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program\DicomViewer\WanLiYunDiagonse\Bin;C:\Users\Administrator\AppData\Roaming\npm;C:\Python27;C:\Program\DicomViewer\WanLiYunDiagonse\Bin
10 verbose lifecycle [email protected]~start: CWD: E:\CodeSpace\SCM_TEST\desktop
11 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'electron app' ]
12 silly lifecycle lifec[email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `electron app`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:242:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:852:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid [email protected]
16 verbose cwd E:\CodeSpace\SCM_TEST\desktop
17 error Windows_NT 10.0.10586
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.3.0
20 error npm  v3.10.5
21 error code ELIFECYCLE
22 error [email protected] start: `electron app`
22 error Exit status 1
23 error Failed at the [email protected] start script 'electron app'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the lifeccp-desktop package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     electron app
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs lifeccp-desktop
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls lifeccp-desktop
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

 

Solution:

This is how I solved the issue on Windows 8.1

Go to your nodejs install (usually C:\Program Files\nodejs)

Right click node_modules folder and go to properties

Click the Security tab and advanced

At the top you will see “Owner: SYSTEM”. Click change.

Enter the user you want permissions for and click ok

Check the box at the bottom of the advanced settings “Replace all child object permission entries with inheritable permission entries from this object” and click ok

Do whatever npm install/update you need.

Error code integrity is reported when installing cnpm in NPM

npm installation cnpm error code EINTEGRITY
error display

PS C:\Users\by\Desktop\element_ui_demo> npm install –g/. npm
npm ERR! EINTEGRITY code
npm ERR! sha512-DowXzQwtSWDtbAjuWecuEiismR0VdNEYaL3VxNTYTdW6AGkYxfGk9LUZ/rt6etEyiH4IEk95HkJeGfXE5Rz9xQ== integrity checksum failed when using sha512: wanted sha512-DowXzQwtSWDtbAjuWecuEiismR0VdNEYaL3VxNTYTdW6AGkYxfGk9LUZ/rt6etEyiH4IEk95HkJeGG4But got sha512-tHlXGeHDDxcwcfwJc/dRDLcLCtuq5y9ATPgiG9tkyLom4u9Yqc+nRbk0JI7c2biglh8jwsUIseBIivimVFmZQg==. ( 5156776 bytes)

because npm version has been detected

If there is a package-lock.json file, it will be 21024;

2.Administrator privileged to cmd

3.executnpm cache clean –force

After

4.npm install -g npm

5npm -vCheck version

The global installation NPM package reported an error and did not have permission

Background: npm i npm-check -g when reporting error no permission Error: EACCES: permission denied, access '/usr/local/lib/node_modules'

1. Check the owner of the directory

ls -la /usr/local/lib/node_modules

total 0
drwxr-xr-x   3 root       wheel   96  6 18 12:42 .
drwxrwxr-x   6 anna       admin  192 12 12 15:45 ..
drwxr-xr-x  23 root       wheel  736 12 26  2018 npm

Discover node_The module is under the root, so you transfer it to yourself

2. Look who it is now

whoami

anna

It’s Anna, not root, so change it

3. Change the directory owner (note the user name Anna)

sudo chown -R anna: /usr/local/lib/node_modules

Popular science: chown change the owner of the specified file to the specified user or group, parameter - R process all files in the specified directory and its subdirectories.

[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