我在尝试使用常春藤工具安装gruntjs时遇到错误。在我的build.xml中有:
<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:
<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被调用时,我得到了以下错误:
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,并从管理控制台运行它,但出现了相同的错误。
发布于 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"
发布于 2014-12-27 21:00:23
无法复制您的问题。远程ANT构建文件不再可用。我也不明白你为什么认为这是常春藤的问题。
我建议您应该从您的构建中调用NPM工具目录。请参阅Grunt的安装文档:
http://gruntjs.com/getting-started
示例
尝试重新创建此问题失败,如下所示:
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
<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>
https://stackoverflow.com/questions/27617535
复制相似问题