Hi I am trying to compile a node_modules as Release mode, but I could not successfully configure as Release mode.
I ran node-gyp configure; the configure.gypi generated
# Do not edit. File was generated by node-gyp's "configure" step {
"target_defaults": {
"cflags": [],
**"default_configuration": "Debug",**
"defines": [],
"include_dirs": [],
"libraries": [] },
I tried with -DBUILDTYPE=Release and BUILDTYPE=Release but not successfully
Default should be Release.
Try node-gyp configure --release
Related
I am using the Visual Studio Code to work with TypeScript.
I created the tasks.json file in order to compile the ts files, but I getting this error when I run it:
/bin/sh: tsc: command not found
The terminal process terminated with exit code: 127
This is my tasks.json file:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
]
}
]
}
Does anyone know what is this?
I am using Linux Mint.
It is not duplicated one of tsc is not recognized as internal or external command
I already tried those steps but it did not worked.
This is my tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true
}
}
Using the terminal when I type node -v it is showing this:
v11.2.0
tsc -v:
Version 3.1.6
It appears that the binary tsc is not in your path. Have the package(s) for TypeScript been installed? This is probably a duplicate of tsc is not recognized as internal or external command
While beginning my work on CS140e today I've completed phase 3 of the project (writing C code to speak directly to GPIO pins on a Raspberry Pi 3 which would simply blink an LED) but on phase 4, once I attempt to compile my solution in Rust, rustc seems to not be able to find the aarch64-none-elf target:
➜ phase4 git:(master) ✗ make
+ Building target/aarch64-none-elf/release/libblinky.a [xargo --release]
WARNING: the sysroot can't be built for the Stable channel. Switch to nightly.
warning: `panic` setting is ignored for `test` profile
Compiling rlibc v1.0.0
error[E0463]: can't find crate for `core`
|
= note: the `aarch64-none-elf` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: Could not compile `rlibc`.
To learn more, run the command again with --verbose.
Makefile:35: recipe for target 'target/aarch64-none-elf/release/libblinky.a' failed
make: *** [target/aarch64-none-elf/release/libblinky.a] Error 101
and, indeed, rustc --print target-list doesn't include aarch64-none-elf:
➜ phase4 git:(master) ✗ rustc --print target-list
aarch64-linux-android
aarch64-unknown-cloudabi
aarch64-unknown-freebsd
aarch64-unknown-fuchsia
aarch64-unknown-linux-gnu
aarch64-unknown-linux-musl
aarch64-unknown-openbsd
...
Though I have installed the toolchain:
➜ phase4 git:(master) ✗ whereis aarch64-none-elf-gcc
aarch64-none-elf-gcc: /usr/local/bin/aarch64-none-elf/bin/aarch64-none-elf-gcc
Also, I have a custom target file named aarch64-none-elf.json with these contents (presumably passed to xargo when building):
{
"abi-blacklist": [
"stdcall",
"fastcall",
"vectorcall",
"thiscall",
"win64",
"sysv64"
],
"arch": "aarch64",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"executables": true,
"linker": "aarch64-none-elf-ld",
"linker-flavor": "ld",
"linker-is-gnu": true,
"llvm-target": "aarch64-unknown-none",
"no-compiler-rt": true,
"features": "+a53,+strict-align",
"max-atomic-width": 128,
"os": "none",
"panic": "abort",
"panic-strategy": "abort",
"position-independent-executables": true,
"target-c-int-width": "32",
"target-endian": "little",
"target-pointer-width": "64",
"disable-redzone": true
}
Turns out all I needed to do was run rustup default nightly and use the nightly version of rustc, as mentioned in the warning and I'm able to get past that error. If anyone want's to explain why this is, that'd be nice.
➜ phase4 git:(master) ✗ rustc --version
rustc 1.30.0-nightly (33b923fd4 2018-08-18)
I have installed Haskell minimal installer on Windows 10. I have been using haskell by writiting small programs in Notepad++ and running then by ghci using ':l myfile.hs'
I have now installed the hackable 'ATOM' text editor and installed the atom-haskell core packages.
However, I get the error below
Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT
Error was: Error
spawn ghc-mod ENOENT
Debug information:
{
"dir": "C:\\Users\\myfunnyusrname\\Desktop",
"err": {
"code": "ENOENT",
"errno": "ENOENT",
"syscall": "spawn ghc-mod",
"path": "ghc-mod",
"spawnargs": [
"version"
],
"cmd": "ghc-mod version"
},
"opts": {
"cwd": "C:\\Users\\myfunnyusrname\\Desktop",
"env": {
"Path": "C:\\Program Files\\Haskell\\bin;C:\\Program Files\\Haskell Platform\\8.0.2-a\\lib\\extralibs\\bin;C:\\Program Files\\Haskell Platform\\8.0.2-a\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files\\Java\\jdk1.8.0_121;C:\\Program Files\\Haskell Platform\\8.0.2-a\\mingw\\bin;C:\\Program Files\\nodejs\\;C:\\Ruby24-x64\\bin;C:\\Users\\myfunnyusrname\\Anaconda3;C:\\Users\\myfunnyusrname\\Anaconda3\\Scripts;C:\\Users\\myfunnyusrname\\Anaconda3\\Library\\bin;C:\\Users\\myfunnyusrname\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\myfunnyusrname\\AppData\\Roaming\\npm",
"PATH": "C:\\Program Files\\Haskell\\bin;C:\\Program Files\\Haskell Platform\\8.0.2-a\\lib\\extralibs\\bin;C:\\Program Files\\Haskell Platform\\8.0.2-a\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files\\Java\\jdk1.8.0_121;C:\\Program Files\\Haskell Platform\\8.0.2-a\\mingw\\bin;C:\\Program Files\\nodejs\\;C:\\Ruby24-x64\\bin;C:\\Users\\myfunnyusrname\\Anaconda3;C:\\Users\\myfunnyusrname\\Anaconda3\\Scripts;C:\\Users\\myfunnyusrname\\Anaconda3\\Library\\bin;C:\\Users\\myfunnyusrname\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\myfunnyusrname\\AppData\\Roaming\\npm"
},
"encoding": "utf8",
"maxBuffer": null
}
}
Environment (filtered):
{
"Path": "C:\\Program Files\\Haskell\\bin;C:\\Program Files\\Haskell Platform\\8.0.2-a\\lib\\extralibs\\bin;C:\\Program Files\\Haskell Platform\\8.0.2-a\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files\\Java\\jdk1.8.0_121;C:\\Program Files\\Haskell Platform\\8.0.2-a\\mingw\\bin;C:\\Program Files\\nodejs\\;C:\\Ruby24-x64\\bin;C:\\Users\\myfunnyusrname\\Anaconda3;C:\\Users\\myfunnyusrname\\Anaconda3\\Scripts;C:\\Users\\myfunnyusrname\\Anaconda3\\Library\\bin;C:\\Users\\myfunnyusrname\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\myfunnyusrname\\AppData\\Roaming\\npm"
}
Show Stack Trace
I understand that i am missing something BUT I do not know anything about PATH and variables.
If someone could please help me, I would be grateful to you
Note: I am using WINDOWS 10 laptop
Edit:
I have now installed ghc-mod (thanks to #Mark Seemann). But when i try 'ghc-mod' from gitbash I get:
K#ORUKO-PC MINGW64 ~
$ ghc-mod
bash: ghc-mod: command not found
Getting Haskell to work on Windows 10 in Atom is doable, but it does require a bit of fidgeting before you can get it to work.
ghc-mod
IIRC, ghc-mod isn't part of the GHC installation, so the first step you most likely need to take is to add it.
Cabal
If you're only using GHC (and not Stack), you can install it using Cabal:
$ cabal install ghc-mod
Stack
If you're just getting started with Haskell, then you probably want to stick with Cabal, but once you've gotten the hang of it and need to do slightly more complicated work, you should consider using Stack instead.
I usually have fairly good success with running
$ stack build ghc-mod
in my Stack project directory, but the Atom editor project has more detailed guidance here: https://github.com/atom-haskell/haskell-ghc-mod/wiki/Using-with-stack
I am deploying a node-js app to heroku that requires the npm package imagemagic-native.
I made the buildpack install libmagick++-dev and export the include path:
export INCLUDE_PATH="$BUILD_DIR/.apt/usr/include:$INCLUDE_PATH"
export CPATH="$INCLUDE_PATH"
export CPPPATH="$INCLUDE_PATH"
Upon installing the imagemagic-native package with npm install, node-gyp is invoked to compile it's binaries. However I get this error:
remote: > imagemagick-native#1.7.0 install /tmp/build_720834c3a32b65d69ae603d7c618e20f/node_modules/imagemagick-native
remote: > node-gyp rebuild
remote:
remote: make: Entering directory `/tmp/build_720834c3a32b65d69ae603d7c618e20f/node_modules/imagemagick-native/build'
remote: CXX(target) Release/obj.target/imagemagick/src/imagemagick.o
remote: In file included from ../src/imagemagick.cc:9:
remote: ../src/imagemagick.h:1:22: warning: Magick++.h: No such file or directory
This suggests that gcc doesn't see the header files for libmagick++, because $CCPATH is not available to it.
How can I make npm install add the path to the list of include_dirs that node-gyp uses?
More detail about my use case is here: Using Magick++ in a node.js application on heroku
Try:
setting the environment variable CXX=/path/to/g++ -Ipath/to/include
and then restarting the process. If you're using bash this is done by
export CXX="/path/to/g++ -Ipath/to/include"
/path/to/include being where the missing header Magick++.h is located
if that doesn't work you may manually have to set CXX to include the -I in the makefile at /tmp/build_720834c3a32b65d69ae603d7c618e20f/node_modules/imagemagick-native/build then cding into that directory and calling make.
I've spent some time trying to answer the same question. In the end, i've found the proper way to do this here. You need to set 'include_dirs' property in ~/.node-gyp/x.x.x/common.gypi.
This is how I've set the include dir on Mac OS to /opt/local/include/ (which is where all macports intalls go):
...
['OS=="mac"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'include_dirs': ['/opt/local/include'],
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
...
Though I'm not sure it's applicable for heroku environment.
You can also use the "include_dirs" option in your project binding.gyp file. Read more about available options on the format description page.
You can now do OTHER_CFLAGS='-I/usr/local/include' supposedly. See https://github.com/nickdesaulniers/node-nanomsg/pull/144
I'm trying to integrate a Node.js addon into an existing build system based on CMake. The addon build requires a large number of preprocessor macro definitions and library dependencies that are available in the CMake context. I would like to be able to pass these into node-gyp when it is invoked by CMake. Unfortunately, I have not been able to find a simple way to do so.
I've tried using the approach used for plain old gyp like this:
node-gyp configure -d -DPOSIX=1
but the -D option doesn't seem to be passed on by node-gyp. Looking at the source for node-gyp, this isn't entirely surprising. Is there a straightforward, direct way to do this, or am I stuck with generating the entries in binding.gyp programmatically, pulling in this information from the environment or something else along those lines?
Use "defines".
{
"targets": [
{
"target_name": "MyAddon",
"sources": [ "File1.cpp", "File2.cpp" ],
"libraries": [ "MyNeeded.lib" ],
"defines": [ "_UNICODE", "UNICODE" ]
}
]
}
This adds the defines to the in your config.gypi when running node-gyp configure
I'm not sure why you see a downside to using the cflags setting in binding.gyp - but I just make something similar work by setting the flags using .bashrc
export CFLAGS='-m32'
export CXXFLAGS='-m32'
export LDFLAGS='-m3'