npm install 在执行期间清空的 uglify-js 文件夹上失败
npm install fails on an uglify-js folder that is emptying during its execution
我正在进入一个项目,其中 npm 会产生一个问题很长时间,并且 none 知道它出现的时间和原因。我想知道在哪里(或什么)搜索的一些线索。
一个简单的 mvn clean install
在安装 npm 插件后执行 npm install
。
我可以看到他的工作涉及创建(或存在)一个 link 将创建一个目录
target/node/node_modules/uglify-js
定位 ~/front-end/uglify-js/
最后一个似乎是我们项目的源文件夹 (?),或者 npm
需要的东西(我自己不知道 uglify)。如我所见:
find ~/front-end/target/node/node_modules -type l -ls
3096224744204072 0 lrwxrwxrwx 1 me 1049089 101 Oct 18 09:20 /c/Users/front-end/target/node/node_modules/uglify-js -> /c/Users/front-end/uglify-js/
该文件夹 ~/front-end/uglify-js/
最初包含文件 package.json
、index.js
和 link-package.js
但是当 npm install
发生时,它在 addLocal
内部步骤失败。
[INFO] --- frontend-maven-plugin:1.3:npm (npm install) @ front-end ---
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.3:npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.3, parent: sun.misc.Launcher$AppClassLoader@4e25154f]
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.3:npm' with basic configurator -->
[DEBUG] (f) arguments = install
[DEBUG] (f) installDirectory = C:\Users\front-end\target
[DEBUG] (f) npmInheritsProxyConfigFromMaven = true
[DEBUG] (f) project = MavenProject: com.front-end:front-end:10.7.14-xxx_yyyyy @ C:\Users\front-end\pom.xml
[DEBUG] (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@585c13de
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@187eb9a8
[DEBUG] (f) skip = false
[DEBUG] (f) skipTests = false
[DEBUG] (f) workingDirectory = C:\Users\front-end
[DEBUG] (f) execution = com.github.eirslett:frontend-maven-plugin:1.3:npm {execution: npm install}
[DEBUG] -- end configuration --
[INFO] Running 'npm install' in C:\Users\front-end
[ERROR] npm ERR! addLocal Could not install C:\Users\front-end\uglify-js
[ERROR] npm ERR! Windows_NT 10.0.18363
[ERROR] npm ERR! argv "C:\Users\front-end\target\node\node.exe" "C:\Users\front-end\target\node\node_modules\npm\bin\npm-cli.js" "install"
[ERROR] npm ERR! node v10.24.1
[ERROR] npm ERR! npm v2.15.12
[ERROR] npm ERR! code EISDIR
[ERROR] npm ERR! errno -4068
[ERROR] npm ERR! syscall read
[ERROR]
[ERROR] npm ERR! eisdir EISDIR: illegal operation on a directory, read
[ERROR] npm ERR! eisdir This is most likely not a problem with npm itself
[ERROR] npm ERR! eisdir and is related to npm not being able to find a package.json in
[ERROR] npm ERR! eisdir a package you are trying to install.
发生此故障后我可以看到,我的磁盘上有一个现有文件夹 ~/front-end/uglify-js/
,但它现在是空的:它已被重新创建。
而 npm-debug.log
除了上面那个以外没有提供其他信息。
如果我恢复该目录中丢失的文件(package.json
、index.js
、link-package.js
)并重试mvn clean install
,此问题将不会重现。
好像它每天只发生一次?嗯...不确定...
我们的 node 和 npm 版本是:node v10.24.1
和 npm v2.15.12
.
我们最终发现是 Maven 问题导致了我们的麻烦。
它不遵守它的 <followSymLinks>false</followSymLinks>
设置并遵循它,并且在删除 target
目录中的 link 文件期间,npm
导致(通过Maven)删除link.
的文件源
我正在进入一个项目,其中 npm 会产生一个问题很长时间,并且 none 知道它出现的时间和原因。我想知道在哪里(或什么)搜索的一些线索。
一个简单的 mvn clean install
在安装 npm 插件后执行 npm install
。
我可以看到他的工作涉及创建(或存在)一个 link 将创建一个目录
target/node/node_modules/uglify-js
定位 ~/front-end/uglify-js/
最后一个似乎是我们项目的源文件夹 (?),或者 npm
需要的东西(我自己不知道 uglify)。如我所见:
find ~/front-end/target/node/node_modules -type l -ls
3096224744204072 0 lrwxrwxrwx 1 me 1049089 101 Oct 18 09:20 /c/Users/front-end/target/node/node_modules/uglify-js -> /c/Users/front-end/uglify-js/
该文件夹 ~/front-end/uglify-js/
最初包含文件 package.json
、index.js
和 link-package.js
但是当 npm install
发生时,它在 addLocal
内部步骤失败。
[INFO] --- frontend-maven-plugin:1.3:npm (npm install) @ front-end ---
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.3:npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.3, parent: sun.misc.Launcher$AppClassLoader@4e25154f]
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.3:npm' with basic configurator -->
[DEBUG] (f) arguments = install
[DEBUG] (f) installDirectory = C:\Users\front-end\target
[DEBUG] (f) npmInheritsProxyConfigFromMaven = true
[DEBUG] (f) project = MavenProject: com.front-end:front-end:10.7.14-xxx_yyyyy @ C:\Users\front-end\pom.xml
[DEBUG] (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@585c13de
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@187eb9a8
[DEBUG] (f) skip = false
[DEBUG] (f) skipTests = false
[DEBUG] (f) workingDirectory = C:\Users\front-end
[DEBUG] (f) execution = com.github.eirslett:frontend-maven-plugin:1.3:npm {execution: npm install}
[DEBUG] -- end configuration --
[INFO] Running 'npm install' in C:\Users\front-end
[ERROR] npm ERR! addLocal Could not install C:\Users\front-end\uglify-js
[ERROR] npm ERR! Windows_NT 10.0.18363
[ERROR] npm ERR! argv "C:\Users\front-end\target\node\node.exe" "C:\Users\front-end\target\node\node_modules\npm\bin\npm-cli.js" "install"
[ERROR] npm ERR! node v10.24.1
[ERROR] npm ERR! npm v2.15.12
[ERROR] npm ERR! code EISDIR
[ERROR] npm ERR! errno -4068
[ERROR] npm ERR! syscall read
[ERROR]
[ERROR] npm ERR! eisdir EISDIR: illegal operation on a directory, read
[ERROR] npm ERR! eisdir This is most likely not a problem with npm itself
[ERROR] npm ERR! eisdir and is related to npm not being able to find a package.json in
[ERROR] npm ERR! eisdir a package you are trying to install.
发生此故障后我可以看到,我的磁盘上有一个现有文件夹 ~/front-end/uglify-js/
,但它现在是空的:它已被重新创建。
而 npm-debug.log
除了上面那个以外没有提供其他信息。
如果我恢复该目录中丢失的文件(package.json
、index.js
、link-package.js
)并重试mvn clean install
,此问题将不会重现。
好像它每天只发生一次?嗯...不确定...
我们的 node 和 npm 版本是:node v10.24.1
和 npm v2.15.12
.
我们最终发现是 Maven 问题导致了我们的麻烦。
它不遵守它的 <followSymLinks>false</followSymLinks>
设置并遵循它,并且在删除 target
目录中的 link 文件期间,npm
导致(通过Maven)删除link.