首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >从ivy安装gruntjs时出错

从ivy安装gruntjs时出错
EN

Stack Overflow用户
提问于 2014-12-23 17:30:51
回答 2查看 138关注 0票数 0

我在尝试使用常春藤工具安装gruntjs时遇到错误。在我的build.xml中有:

代码语言:javascript
运行
复制
<echo message="installing gruntjs support..." />
<get src="http://ivy.iwin.com/gruntjs-build.xml" dest="${gruntjs.build.file}" usetimestamp="true" />
<import file="${gruntjs.build.file}" />

这个gruntjs-build.xml安装nodejs:

代码语言:javascript
运行
复制
<echo message="installing nodejs support..." />
<get src="http://ivy.iwin.com/nodejs-build.xml" dest="${nodejs.build.file}" usetimestamp="true" />
<import file="${nodejs.build.file}" />

当"gruntjs.install“taks被调用时,我得到了以下错误:

代码语言:javascript
运行
复制
gruntjs.install:
     [exec] npm ERR! 404 404 Not Found: %3E
     [exec] npm ERR! 404
     [exec] npm ERR! 404 '%3E' is not in the npm registry.
     [exec] npm ERR! 404 You should bug the author to publish it
     [exec] npm ERR! 404
     [exec] npm ERR! 404 Note that you can also install from a
     [exec] npm ERR! 404 tarball, folder, or http url, or git url.
     [exec]
     [exec] npm ERR! System Windows_NT 6.2.9200
     [exec] npm ERR! command "c:\\project-dir\\nodejs-lib\\\\node.exe" "c:\\project-dir\\nodejs-lib\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli" "--prefix" "c:\\project-dir/nodejs-lib" ">" "_tempfile.out" "2>&1"
     [exec] npm ERR! cwd c:\project-dir
     [exec] npm ERR! node -v v0.10.32
     [exec] npm ERR! npm -v 1.4.12
     [exec] npm ERR! code E404
     [exec] npmThe system cannot find the file specified.
     [exec] Could Not Find c:\project-dir\_tempfile.out

如果我运行"touch _tempfile.out",它会继续其他“某个文件不在npm注册表中”。我认为问题在于nodejs是如何安装的。我试图卸载nodejs,并从管理控制台运行它,但出现了相同的错误。

EN

回答 2

Stack Overflow用户

发布于 2014-12-27 13:47:47

这里的问题是整个命令行都被传递给npm,包括字符>npm将其转义为%3E。

某些东西正在调用带有参数"c:\\project-dir\\nodejs-lib\\\\node.exe" "c:\\project-dir\\nodejs-lib\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli" "--prefix" "c:\\project-dir/nodejs-lib" ">" "_tempfile.out" "2>&1"npm

因此,npm认为您希望安装名为">" "_tempfile.out" "2>&1"模块,而不是将输出和标准错误重定向到_tempfile.out

什么在调用npm (常春藤?maven?其他工具?)可能有一种带外的方式来指定输出重定向,所以尝试查看您的配置文件,查看指定"_tempfile.out"的位置,并查看是否可以使用以下命令行运行node

"c:\\project-dir\\nodejs-lib\\\\node.exe" "c:\\project-dir\\nodejs-lib\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli" "--prefix" "c:\\project-dir/nodejs-lib"

票数 1
EN

Stack Overflow用户

发布于 2014-12-27 21:00:23

无法复制您的问题。远程ANT构建文件不再可用。我也不明白你为什么认为这是常春藤的问题。

我建议您应该从您的构建中调用NPM工具目录。请参阅Grunt的安装文档:

http://gruntjs.com/getting-started

示例

尝试重新创建此问题失败,如下所示:

代码语言:javascript
运行
复制
build:
     [echo] installing nodejs support...
      [get] Getting: http://ivy.iwin.com/nodejs-build.xml
      [get] To: /home/mark/tmp/build.xml.tmp
      [get] Error opening connection java.io.FileNotFoundException: http://ivy.iwin.com/nodejs-build.xml
      [get] Error opening connection java.io.FileNotFoundException: http://ivy.iwin.com/nodejs-build.xml
      [get] Error opening connection java.io.FileNotFoundException: http://ivy.iwin.com/nodejs-build.xml
      [get] Can't get http://ivy.iwin.com/nodejs-build.xml to /home/mark/tmp/build.xml.tmp

build.xml

代码语言:javascript
运行
复制
<project name="demo" default="build">

  <property name="nodejs.build.file" location="build.xml.tmp"/>

  <target name="build">
    <echo message="installing nodejs support..." />
    <get src="http://ivy.iwin.com/nodejs-build.xml" dest="${nodejs.build.file}" usetimestamp="true" />
    <import file="${nodejs.build.file}" />
  </target>

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

https://stackoverflow.com/questions/27617535

复制
相关文章

相似问题

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