Tag Archives: npm

How to Solve NPM install truffle error

NPM error reporting

In fact, if an error is reported, most of them are OK

Truffle cannot run after installation

Enter your own NPM package

You can find this location according to your location

If there is a truss, the installation is correct,

But NPM doesn’t add soft links to you

Add a soft link to your path

This is the location of the path

Select a location to add a soft link

Then verify

end

NPM Error: npm ERR! 426 Upgrade Required [How to Solve]

Today, NPM sent a packet and reported error e426.

npm ERR! code E426
npm ERR! 426 Upgrade Required - PUT http://registry.npmjs.org/formats_date

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-11-25T06_55_02_155Z-debug.log
error Command failed with exit code 1.

NPM is upgraded to tls1.2.TLS 1.1\1.0 is not accepted.

Various attempts still report errors. Various searches have finally found the reason. HTTPS needs to be used when modifying the image

npm config set registry=https://registry.npmjs.org

[Solved] NPM downloads the dependency of the front-end Vue admin template master template Error

The front end uses Vue admin template master. When using NPM to download dependencies, errors are always reported

When I first used Vue admin template master, it was a video resource. The result was an error, which Baidu couldn’t find out. I don’t think it’s possible that I went to the official website to download because the version is old. I really solved some bugs, but it’s not enough. The error reports are as follows

error code 1
error path F:\webstrom项目\SpringBoot大项目实战\vue-admin-template-master\node_modules\deasync
error command failed
error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
error gyp info it worked if it ends with ok
error gyp info using [email protected]
error gyp info using [email protected] | win32 | x64
error gyp info find Python using Python version 3.7.7 found at "C:\Users\asus\AppData\Local\Programs\Python\Python37\python.exe"
error gyp ERR! find VS
error gyp ERR! find VS msvs_version not set from command line or npm config
error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
error gyp ERR! find VS could not use PowerShell to find Visual Studio or newer, try re-running with '--loglevel silly' for more details
error gyp ERR! find VS looking for Visual Studio 2015
error gyp ERR! find VS - not found
error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
error gyp ERR! find VS
error gyp ERR! find VS **************************************************************
9800 error gyp ERR! find VS You need to install the latest version of Visual Studio
9800 error gyp ERR! find VS including the "Desktop development with C++" workload.
9800 error gyp ERR! find VS For more information consult the documentation at:
error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
error gyp ERR! find VS **************************************************************
error gyp ERR! find VS
error gyp ERR! configure error
error gyp ERR! stack Error: Could not find any Visual Studio installation to use
error gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
error gyp ERR! stack     at C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
error gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
error gyp ERR! stack     at C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
error gyp ERR! stack     at C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
error gyp ERR! stack     at C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
error gyp ERR! stack     at C:\Users\asus\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
error gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
error gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
error gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
error gyp ERR! System Windows_NT 10.0.19042
error gyp ERR! command "D:\\node.js\\node.exe" "C:\\Users\\asus\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
9800 error gyp ERR! cwd F:\webstrom项目\SpringBoot大项目实战\vue-admin-template-master\node_modules\deasync
error gyp ERR! node -v v16.13.0
error gyp ERR! node-gyp -v v8.3.0
error gyp ERR! not ok
verbose exit 1

Google found out that the version of node.js is too high and should be reduced. I downloaded the stable version of the official website. I don’t want to reduce the version.

**************************************************************
9800 error gyp ERR! find VS You need to install the latest version of Visual Studio
9800 error gyp ERR! find VS including the "Desktop development with C++" workload.
9800 error gyp ERR! find VS For more information consult the documentation at:
error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
error gyp ERR! find VS **************************************************************

Problem solving: download the latest version of visual studio. I downloaded visual studio 2019

 

NPM Install vue-cli Error: internal/modules/cjs/loader.js (Error: Cannot find module ‘D:\Program\nodejs\node_global\node_modules\vue-cli\bin\vue’)

1. Vue cli installation encountered a problem

Install the new version of Vue cli command: NPM install – G @Vue/cli. After successful installation, use Vue – V to check the version number. An error is found:

PS D:\Program\nodejs\node_global> vue -V
internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'D:\Program\nodejs\node_global\node_modules\vue-cli\bin\vue'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
PS D:\Program\nodejs\node_global> npm -v
6.4.1

This error occurs when checking the Vue version or creating a new Vue project. Uninstalling Vue CLI and reinstalling will also report an error.

2. Solution

1. Find the installation location of your Vue first (you need to view the global location of your NPM installation)

My is installed in this directory. You can see that there will be two files. When there is a problem, the vue.cmd file is the latest (today’s), but the Vue file is 2020 (before). Therefore, it is speculated that the Vue versions of the two files may be inconsistent.

2. Get the location of the Vue file and delete it

Delete the remaining Vue files (delete these 2 files)

3. Uninstall Vue CLI and then reinstall it.

PS D:\Program\nodejs\node_global> vue -V
@vue/cli 4.5.13

This is successful.

Summary:

1. You can install without an administrator, but CMD should be run as an administrator when uninstalling;

2. Be calm when you encounter problems and remember to find the cause of the problem according to the error information. (there are too many Baidu search solutions for environmental problems, but many of them are not necessarily the same as the problems you encounter. Some others can solve them, but your problems may not be solved. It may lead to some other pits, so be careful.)

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 [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle lifec[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.