Execute
npm init -f
npm init -f
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-11-29T02_05_58_628Z-debug.log
Solution:
npm install [email protected] --ignore-scripts
Although the warning has vulnerabilities, it will not affect the operation
Solution 1: NMP clear cache: NPM cache clean — force
solution 2: clear nodes in the project_ Delete the modules file, and then execute NPM install. Then you will find that there is no warning.
Explanation: the solution principle is the same
npm ERR! [email protected] install: `node install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node install.js
You should add the parameter — ignore scripts after the command
npm install --ignore-scripts
The error content is similar to the following format. See here for specific solutions: https://github.com/Microsoft/WSL/issues/14
Focus on https://github.com/Microsoft/WSL/issues/14#issuecomment -207504657 and https://github.com/Microsoft/WSL/issues/14#issuecomment -514342783
The previous articles recording this kind of stepping on the pit are purely to stick the solution of the original text. If there is no original content in the future, directly post links and error tips to facilitate visiting readers
➜ * git:(master) ✗ npm install
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /home/*/Project/*/node_modules/array-sort
npm ERR! dest /home/*/Project/*/node_modules/.array-sort.DELETE
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/home/*/Project/*/node_modules/array-sort' -> '/home/*/Project/*/node_modules/.array-sort.DELETE'
npm ERR! [OperationalError: EACCES: permission denied, rename '/home/*/Project/*/node_modules/array-sort' -> '/home/*/Project/*/node_modules/.array-sort.DELETE'] {
npm ERR! cause: [Error: EACCES: permission denied, rename '/home/*/Project/*/node_modules/array-sort' -> '/home/*/Project/*/node_modules/.array-sort.DELETE'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/home/*/Project/*/node_modules/array-sort',
npm ERR! dest: '/home/*/Project/*/node_modules/.array-sort.DELETE'
npm ERR! },
npm ERR! stack: "Error: EACCES: permission denied, rename '/home/*/Project/*/node_modules/array-sort' -> '/home/*/Project/*/node_modules/.array-sort.DELETE'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/home/*/Project/*/node_modules/array-sort',
npm ERR! dest: '/home/*/Project/*/node_modules/.array-sort.DELETE',
npm ERR! parent: 'MyIP'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/*/.npm/_logs/2019-12-24T05_53_16_578Z-debug.log
Original text: https://blog.csdn.net/weixin_41715295/article/details/79508104
The error – 4048 operation not allowed has been reported when NPM install is used these days. Many methods have been tried and finally the problem has been solved. Here are several methods summarized. First:
First, when we see operation not allowed, we can think of the permission problem, so at this time, we can run CMD as an administrator or directly open it by pressing the shortcut key win + X
As shown in the figure above, according to the error log, we can clearly see that the minimach version is too low and the dash dash error. As long as we install the two packages globally, the problem can be solved perfectly.
when we install some scaffolds such as Vue cli or angular cli in NPM install or through NPM install, and then the construction project reports errors, we can correctly install the required dependency packages globally through error prompts.
generally, in this case, we need to focus on the key word after operation not permitted and the following directory
The latest version of NPM 5.4.0 lacks dependent packages when installing packages. In this case, we need to install a lower version of NPM: NPM I – G [email protected] (fill in the specified version you need here)
The above are some methods summarized by individuals according to their own situations. Of course, the focus is on looking at their own error log tips
What are the eight life cycle hook functions of Vue>>>
Run the NPM install command to install the dependency package. It’s OK on the virtual machine installed by vagrant on MAC, and it’s OK on alicloud CentOS. However, it’s not successful on the same virtual machine installed by vagrant on windows. The error is as follows:
npm ERR! Error: EPERM: operation not permitted, rename ‘/usr/share/nginx/html/tanteng.me/node_modules/duplexify' -> ‘/usr/share/nginx/html/tanteng.me/node_modules/.duplexify.DELETE'
Solution: the solution is NPM install – no bin links, plus the following parameters
npm ERR! path E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir ‘E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modules’
npm ERR! { Error: EPERM: operation not permitted, scandir ‘E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modules’
npm ERR! stack: ‘Error: EPERM: operation not permitted, scandir \’E:\\SouthernPowerGridProject\\web_project\\AutoOPS\\autoops\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules\”,
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘scandir’,
npm ERR! path: ‘E:\\SouthernPowerGridProject\\web_project\\AutoOPS\\autoops\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ThinkT420\AppData\Roaming\npm-cache\_logs\2017-10-30T06_50_38_610Z-debug.log
Before there are times this, thought it is really not enough permissions, feel a little strange, with administrator rights to perform, sometimes really useful, but later checked, when the cache problem, clean up the cache on the line, without administrator rights.
Method 1.
You need to delete the npmrc file.
Emphasis: not the nodejs installation directory npm module under the npmrc file
but in C:\Users\{account}\ under the .npmrc file …
Method 2.
Or just clean it up directly with the command, console type.
npm cache clean –force
added 114 packages in 42.369s
E:\SouthernPowerGridProject\web_project\AutoOPS\autoops>npm cache clean –force
npm WARN using –force I sure hope you know what you are doing.
E:\SouthernPowerGridProject\web_project\AutoOPS\autoops>npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”win32″,”arch”:”x64″})
added 114 packages in 42.369s
Done!
When NPM install is executed from the command line, an error is reported as follows:
D:\frontend\viewsdev>npm install
npm ERR! code EINTEGRITY
npm ERR! sha512-8qtu6VYSXUExVPx6H8s8+OhQo0UQP7ogAoOa2bOPCvnhlpaGVYf3yh45WNa7PhhdWSOGQW3DdblqMX8UJ7Cu6g== integrity checksum failed when using sha512: wanted sha512-8qtu6VYSXUExVPx6H8s8+OhQo0UQP7ogAoOa2bOPCvnhlpaGVYf3yh45WNa7PhhdWSOGQW3DdblqMX8UJ7Cu6g== but got sha512-OvgW+e/pBS2QuX5CTDaaE+DM62t8mMk+IJfcpE3Zv1DC03DwoOKcyqRHlA+lkXWahSOPmvYZJSEDUKX0nOeLDw==. (4954746 bytes)
Later, it was found that there was a problem with the NPM version, which needed to be updated to the latest version
D:\frontend\viewsdev>npm install -g npm
C:\Users\wulf\AppData\Roaming\npm\npx -> C:\Users\wulf\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
C:\Users\wulf\AppData\Roaming\npm\npm -> C:\Users\wulf\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
+ [email protected]
added 396 packages in 45.85s
Re install succeeded:
D:\frontend\viewsdev>npm install
> [email protected] preinstall D:\frontend\viewsdev
> npm install ./local_modules/my-htmlone ./local_modules/my-url-loader
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
npm WARN [email protected] requires a peer of file-loader@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
+ [email protected]
+ [email protected]
updated 2 packages and audited 131 packages in 12.198s
found 3 vulnerabilities (2 low, 1 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Has been renamed to https://www.npmjs.com/package/webpack-stream
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: react-tools is deprecated. For more information, visit https://fb.me/react-tools-deprecated
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
> [email protected] install D:\frontend\viewsdev\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.2/win32-x64-57_binding.node
Download complete ] - :
Binary saved to D:\frontend\viewsdev\node_modules\node-sass\vendor\win32-x64-57\binding.node
Caching binary to C:\Users\wulf\AppData\Roaming\npm-cache\node-sass\4.9.2\win32-x64-57_binding.node
> [email protected] postinstall D:\frontend\viewsdev\node_modules\node-sass
> node scripts/build.js
Binary found at D:\frontend\viewsdev\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm WARN [email protected] requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-sass@^3.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 1243 packages from 760 contributors and audited 9576 packages in 186.808s
found 22 vulnerabilities (8 low, 10 moderate, 4 high)
run `npm audit fix` to fix them, or `npm audit` for details
At first, I thought it was a node or NPM version problem. After a long time, I finally solved it
If you have executed NPM install
, delete the node first_ Modules folder, otherwise an error may be reported when running
Execute the following command
npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
Then execute NPM install
to download normally
After analysis, it is found that in some versions, the response of the URL of the zip file of chromedriver is 302 jump, while the get method of the built-in HTTP object of node.js is used in install.js, which cannot handle 302 jump; In other cases, it’s because Google apis.com is blocked. Even if we use scientific Internet access, we still can’t get the files
https://segmentfault.com/a/1190000008310875
https://www.npmjs.com/package/chromedriver