Tag Archives: operation not permitted

NPM run build Error: operation not permitted

1. The project uses Vue framework in NPM run build  Package error:

Access the corresponding directory and find that it cannot be opened. It turns out that the file is occupied by other applications. After a careful look, the xftp file transfer software is open. After closing it, run NPM run build again

the reason for this problem is that when building a project, the previously built project file will be deleted. Because the file is occupied, the file cannot be deleted, so an error will be reported. Just close the corresponding occupation program

2. Vue will report an error after packaging, but the local NPM run dev will not report an error. After checking the reason, it is found that several Chinese names of the packaged JS files are garbled. Change them to English and then package them

 

Use NPM install to report an error – operation not allowed

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:  

I: permission issues

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

2: dependency package error

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

III: NPM version problem

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

Mac prompt operation not permitted solution

This article gives you a comprehensive understanding of Java object serialization and deserialization>>>

Some operations on MAC need system permission. When you enter the correct password, you can set the command: sudo Chmod – R 777 needs to modify the path of the upper directory of the file

However, except in some cases, such as moving sudo to the/usr/bin directory or sudo PIP update, it will still fail and prompt operation not permitted

Reason: SIP (system integrity protection) is enabled in MAC, and rootless mechanism is added. As a result, the file cannot be modified even under the root permission, so the protection mechanism can only be modified after it is closed

1) Restart the computer. When the apple logo appears on the screen, follow Command + R until you enter the protection mode

2) Protection mode: a dialog box in the middle of the screen prompts to restore a backup, or restore the factory system, etc. There is a row of toolbars in the upper left corner

3) Find the terminal terminal in the upper left corner, open it, and enter csrutil disable

4) Restart the computer again to modify the files in the usr/bin directory

PS: if you want to restore the protection mechanism and re-enter the protection mode, enter csrutil enable in the same way