首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >npm安装在执行过程中正在清空的uglify-js文件夹上失败。

npm安装在执行过程中正在清空的uglify-js文件夹上失败。
EN

Stack Overflow用户
提问于 2021-10-18 09:30:36
回答 1查看 163关注 0票数 0

我正在进入一个项目,在那里npm产生了一个问题很长一段时间,而没有人知道什么时候和为什么它出现。我想找到一些线索,知道在哪里(或什么地方)去搜索。

一个简单的mvn clean install在安装了npm插件之后执行一个npm install

我可以看到,他的工作涉及创建(或存在)一个链接,该链接将创建一个目录。

target/node/node_modules/uglify-js靶向~/front-end/uglify-js/

最后一个似乎是源文件夹(?)我们的项目,或者npm需要的东西(我自己也不知道)。如我所见:

代码语言:javascript
复制
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.jsonindex.jslink-package.js文件

但是当npm install发生时,它在addLocal内部步骤上失败。

代码语言:javascript
复制
[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.jsonindex.jslink-package.js)并重试mvn clean install,那么这个问题将不会重现。

好像每天只发生一次?哼..。不确定..。

我们的节点和npm版本是:node v10.24.1npm v2.15.12

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-02-23 20:43:01

我们最终发现,是Maven问题导致了我们的麻烦。

它不尊重它的<followSymLinks>false</followSymLinks>设置并遵循它,并且在删除target目录中的链接文件时,npm会导致(由Maven)删除链接的文件源。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69613756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档