package.json not able to locate file - npm

I have added a script in my script section of package.json which is present at root directory
"packagr": "ng-packagr -p src/ng-package.json"
But while running this script using
npm run pacakgr
gives error saying "no such file or directory" and tries to find my file at location
root/ng-package.json
instead of
root/src/ng-package.json
Does we need some configuration to map files?

It was a stupid mistake and it happened because I wrote the command in microsoft word.
When you type - in word and press space-bar it converts that character to something else.
Accidentally I used "–" character instead of "-"
Though python interpreter shows same ascii value for both the characters.

Related

tar: Error opening archive: Can't initialize filter; unable to run program "bzip2 -d"

I'm trying to run this code from : https://github.com/pnnl/safekit ,using cmd on windows 10, I already installed python.
when I type the command:
tar -xjvf data_examples.tar.bz2
I keep getting the error:
tar: Error opening archive: Can't initialize filter; unable to run
program "bzip2 -d"
I have tried to download bzip2 through easy-7 zip and GnuWin32 , but it didn't work.
Can any one help me?
P.S.: I did search for the same problem before posting mine.
If you run the command in git bash instead of cmd it should work.
I've run into the same problem! My non-elegant solution so far has been to force Windows's tar.exe to use the bzip2.exe provided with my Windows Git installation. The trick is to add to your user PATH the directory where bzip2.exe is located, in my case:
C:\Program Files\Git\mingw64\bin
So, right now my PATH looks like:
Path=%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\mingw64\bin
Notice that I've only touched the user environment PATH, not the system PATH, and I've appended the new directory. As always, touching your PATH can be a little bit dangerous, proceed with care. If someone has a better solution, I'd be glad to hear it.
Note: I tried copying the bzip2.exe to a separate directory, but this didn't work (I presume because bzip2.exe couldn't find some dependencies).

how can I install "elm-light" on windows?

elm-light looks like a great plugin for elm in the LightTable editor, but I can't make it work properly on Windows. When I try to establish a connection, I get this error : Path must be a string. Received null.
Please help...
"Path must be a string" should already be fixed in elm-light-0.42
AST
Auto-completions only starts working once you have connected to an Elm project. You can force "suto.connection", through various commands (Lint, toggle docs etc). So if you hit "ctrl-d" on a symbol when you aren't connected, it will connect for you. Another option is to add the Lint command to the save operation in Light Table. Again see Useful configurations
-- https://rundis.gitbooks.io/elm-light-guide/content/chapter1.html
After opening elm file in Light Table, you can see at the status: AST not connected. That means elm-light doesn't run yet.
You have to connect manually either by running ctrl+space > ELM: Load/reload project AST or better by mapping this action to save.
To do this, run ctrl-space > Settings: User keymap. Add line [:editor.elm "ctrl-s" :save :elm-format :elm.lint] before last ] so it looks like this:
[
;; ...
[:editor.elm "ctrl-s" :save :elm-format :elm.lint]
]
Above mapping to ctrl-s will also format and lint your file.
One more thing. If you type for example import Dict as Dict exposing (, AST will report error. For that we need to automatic brackets close. To do that, run ctrl-space > Settings: User behaviors and add line [:editor :lt.objs.editor/autoclose-brackets], so that the file looks like that:
[
;; ...
[:editor :lt.objs.editor/autoclose-brackets]
]
Avoid spaces in the path to the elm-platform
type echo %path% in a Windows command prompt to check the Elm path
uninstall and reinstall elm in another folder if necessary
Avoid spaces in the path to LightTable
move the LightTable folder if necessary
uninstall and reinstall the elm plugin in the new location
Install elm-oracle
execute npm install elm-oracle in a Windows command prompt to get auto-complete to work.
Install elm-format
Configure keymaps
use ctrl- (Windows) instead of cmd (iOS) in the keychords

Elm Make starts Windows Script Host and gives error?

I'm playing in Elm, and whenever I use elm make I get an error from Windows Script Host:
The error states that there is an error in the build elm.js file. And when I look at the given line, it's the following:
return {
keys: keys, // A hash of key name to index
free: free, // An array of unkeyed item indices
} // line 10547
So I'm guessing it's bitching about the unneeded , on line 10546: free: free,.
But now my question is, why is Windows Script Host doing stuff with my build elm.js file anyway, and how can I fix it?
I already tried disabling Windows Script Host, but then I just get an error stating that it doesn't allow script to be run.
Since you have a file in that directory called elm.js, the Windows Command Line tries executing that when you type elm make. It thinks you are intending this: elm.js make.
You can get around this in a few ways:
Change the name of the output file from elm.js to something else
Move the generated elm.js file to a subdirectory
Run elm-make from the command line instead of elm make
Use another shell like Powershell, Git Bash, or Cygwin

Illegal characters in path for nuget pack

I'm packing an application using Cruise Control, the command is like this
<Exec Command="$(NugetToolPath) pack "#(NuSpecs)" -OutputDirectory \\servername\PackageSource -BasePath "%(NuSpecs.RootDir)%(NuSpecs.Directory)" -NoPackageAnalysis" />
Iv'e narrowed down the error to be the BasePath it comes out as
-BasePath "D:\Code\Mobile_Trunk\PreCompiledWeb\Portal\Mobile LT Admin\"
I know the issue because it should be
-BasePath "D:\Code\Mobile_Trunk\PreCompiledWeb\Portal\Mobile LT Admin"
but because I'm using .Directory metadata it will always return with a \ at the end
I normally wouldn't quote the base path, but since there are spaces in the directory, I have no choice. Is there a way around this? I don't know any other metadata which will return the full folder strucutre other than how I've layed it out
UPDATE:
I came to this solution, it's still not helped my knowledge on how to get around the issue with the illegal path, but it works.
<Exec Command="$(NugetToolPath) pack "%(NuSpecs.RootDir)%(NuSpecs.Directory)%(Nuspecs.FileName).nuspec" -OutputDirectory \\servername\PackageSource -NoPackageAnalysis" />
Just insert a space after the directory and before the quote character:
-OutputDirectory "\\servername\PackageSource\ "
See the accepted answer here (the question itself isn't highly relevant but the answer is):
How to accept command-line args ending in backslash
This fascinating reference is also linked to in another answer on that question:
http://www.daviddeley.com/autohotkey/parameters/parameters.htm#WINCRULESDOC
We got this error when we executed nuget restore from Jenkins, where we ran a JNLP agent on the slave-node.
Turns out that "Path" in Illegal characters in path means the PATH environment variable, and in our case nuget.exe was inheriting a PATH variable that had quotes in it, i.e. something like:
Path=C:\Program Files\foo;"C:\Program Files\bar"
If you are using Jenkins, add echo %PATH% to be executed somewhere by Jenkins, and check if it has any funny characters.
I faced this problem and the error message wasn't too helpful - it did not print out the offending line or path. I had to take out pieces of the config where I suspected the issue might be until I could get to the offending line (removing the offending line allowed the build to pass).
Turns out the offending line had a variable that was blank (I used the Message task to print it out). From there, I was able set the variable to what my project expected.

Get Error while building libav on windows using minGW and MSYS

I have a trouble with libav.
I used MinGW and MSYS to build libav on windows. However, When I use "make", after some file(.o file) were build i get error,
It is
$ make
AR libavcodec/libavcodec.a C:\msys\mingw\bin\ar.exe: libavcodec/: Permission denied
make: *** [libavcodec/libavcodec.a] Error 1
After that, I view the permission of libavcodec folder, I have all permission. :|
Please help me solve this trouble or give me a full instruction to build libav on windows (I use win7 x64 and have msys, mingw)
Thanks!!!
I'm not sure if this is relevant, but I had the same error when trying to make ffmpeg. Initially I was getting a missing separator error (in one of the makefiles) when I used configure. I found a page that suggested checking that git was using unix line endings rather than windows (CR LF). So I used
git config --global core.autocrlf false
to set git to use unix line endings and then thought I'd updated my source (being new to git, it turned out I hadn't). I still got the missing separator error, so I added a tab to the start of the line and configure completed. I then used make and would get the same error you're getting. I saw in some of the other makefiles that they still had windows line endings, so I deleted the entire directory apart from the .git folder as mentioned here, and then used
git reset --hard
to get the files again. After this configure and make worked without error, so my guess would be that you're using windows line endings or there's something wrong with the makefiles.