Closed epicstar closed 7 years ago
node_modules\.bin\grunt.cmd
is automatically generated by npm when grunt is installed. I'm guessing it's likely an issue with your environment or an issue with the specific version of npm you have installed.
@epicstar did you figure this out? I'm seeing same problem
I have not figured it out, but I'm just calling grunt in node_modules/grunt
instead of node_modules/.bin/grunt.cmd
in Windows.
It's not worth my time since I only incidentally found this issue in another project we are using that is primarily built on Unix but sometimes (optionally) built in Windows.
I don't exactly understand why this was closed.... I think it's worth investigating to find out the culprit, which I suspect is a bad mix between OS and NPM version.
It was closed because it is not an issue with grunt-cli
. grunt-cli
doesn't generate those files, npm does.
Even if somebody wanted to help investigate (although you've indicated it's not worth your time, so I'm not sure if anyone else will think it's worth their time), it would be very difficult for them as they don't have the same environment and steps that causes the issue.
This has been an intermittent issue for the Signal Desktop project on Windows for quite some time now, but today it happened four times in a row on AppVeyor:
I even updated the build to print out the current value of grunt.cmd before it starts, and sure enough, the last six characters of the script are repeated:
$ type node_modules\.bin\grunt.cmd
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\grunt\bin\grunt" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\grunt\bin\grunt" %*
)t" %*
)
Usually when this happens and I do a rebuild the issue goes away. This time it hasn't, three times in a row. I'm gonna hit rebuild, see what happens this time...
Description
When I try to run grunt via
node_modules\.bin\grunt
in cmd or powershell, I get the following error:However, running grunt directly using
node node_modules\grunt\bin\grunt
runs fine.The cause of the issue is that line 7 of
grunt.cmd
has the following (at least on my computer):Removing
t"
solves the problem. I will be able to create a simple pull request that fixes this issue on the weekend.Environment
Node was installed through Chocolatey.