Hyperledger Composer v0.20.0 network start error - docker

Composer v0.20.0
Fabric v1.2.1 (docker container)
node v8.15.0
MacOS
I'm running into an error when I try to use the composer network start command. I was following this tutorial: https://hyperledger.github.io/composer/v0.19/tutorials/deploy-to-fabric-single-org
Steps:
1)
cd ~/fabric-dev-servers
export FABRIC_VERSION=hlfv12
./stopFabric.sh
./teardownFabric.sh
./downloadFabric.sh
./startFabric.sh
If I run docker container ls:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64e6d6746649 hyperledger/fabric-peer:1.2.1 "peer node start" 31 seconds ago Up 30 seconds 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
f2ee3f2a68f7 hyperledger/fabric-couchdb:0.4.10 "tini -- /docker-ent…" 32 seconds ago Up 31 seconds 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
41e9a4987f6f hyperledger/fabric-orderer:1.2.1 "orderer" 32 seconds ago Up 31 seconds 0.0.0.0:7050->7050/tcp orderer.example.com
1673c6691baf hyperledger/fabric-ca:1.2.1 "sh -c 'fabric-ca-se…" 32 seconds ago Up 31 seconds 0.0.0.0:7054->7054/tcp ca.org1.example.com
Then I ran rm -fr ~/.composer
2)
composer card create -p connection.json -u PeerAdmin -c ~/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/signcerts/Admin#org1.example.com-cert.pem -k ~/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk -r PeerAdmin -r ChannelAdmin
I got this back:
Successfully created business network card file to
Output file: PeerAdmin#mogvl-net.card
Command succeeded
3)
composer card import -f PeerAdmin#mogvl-net.card
I got this back:
Successfully imported business network card
Card file: PeerAdmin#mogvl-net.card
Card name: PeerAdmin#mogvl-net
Command succeeded
4)
composer network install -c PeerAdmin#mogvl-net -a dist/mogvl-network.bna
I got this back:
✔ Installing business network. This may take a minute...
Successfully installed business network mogvl-network, version 0.2.6
Command succeeded
5)
composer network start --networkName mogvl-network --networkVersion 0.2.6 -A admin -S adminpw -c PeerAdmin#mogvl-net
I got this error back:
Starting business network mogvl-network at version 0.2.6
Processing these Network Admins:
userName: admin
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: failed to execute transaction 5de6713450900a4f1ac035bec47136a54c5ce5e03722700c0a85feef782ed738: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.6.2 - Run `npm i npm#latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm#latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN deprecated boom#2.10.1: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated cryptiles#2.0.5: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated hoek#2.16.3: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated boom#4.3.1: This version is no longer maintained. Please upgrade to the latest version.
> node#11.10.0 preinstall /chaincode/output/node_modules/node
> node installArchSpecificPackage
+ node-linux-x64#11.10.0
added 1 package in 2.904s
> x509#0.3.4 install /chaincode/output/node_modules/x509
> node-gyp rebuild
make: Entering directory '/chaincode/output/node_modules/x509/build'
CXX(target) Release/obj.target/x509/src/addon.o
CXX(target) Release/obj.target/x509/src/x509.o
../src/x509.cc: In function 'std::__cxx11::string parse_args(const Nan::FunctionCallbackInfo<v8::Value>&)':
../src/x509.cc:41:25: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
if (info[0]->ToString()->Length() == 0) {
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
Local<String> Value::ToString() const {
^
../src/x509.cc:46:45: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
return *Nan::Utf8String(info[0]->ToString());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
Local<String> Value::ToString() const {
^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE verify(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:55:64: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
std::string cert_path = *String::Utf8Value(info[0]->ToString());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
Local<String> Value::ToString() const {
^
../src/x509.cc:55:65: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated: Use Isolate version [-Wdeprecated-declarations]
std::string cert_path = *String::Utf8Value(info[0]->ToString());
^
In file included from /root/.node-gyp/11.10.0/include/node/v8.h:26:0,
from /root/.node-gyp/11.10.0/include/node/node.h:63,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:2992:28: note: declared here
explicit Utf8Value(Local<v8::Value> obj));
^
/root/.node-gyp/11.10.0/include/node/v8config.h:326:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/x509.cc:56:67: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
std::string ca_bundlestr = *String::Utf8Value(info[1]->ToString());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
Local<String> Value::ToString() const {
^
../src/x509.cc:56:68: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated: Use Isolate version [-Wdeprecated-declarations]
std::string ca_bundlestr = *String::Utf8Value(info[1]->ToString());
^
In file included from /root/.node-gyp/11.10.0/include/node/v8.h:26:0,
from /root/.node-gyp/11.10.0/include/node/node.h:63,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:2992:28: note: declared here
explicit Utf8Value(Local<v8::Value> obj));
^
/root/.node-gyp/11.10.0/include/node/v8config.h:326:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE get_altnames(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:118:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local<Object> exports(try_parse(parsed_arg)->ToObject());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
Local<Object> Value::ToObject() const {
^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE get_subject(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:131:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local<Object> exports(try_parse(parsed_arg)->ToObject());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
Local<Object> Value::ToObject() const {
^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE get_issuer(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:144:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local<Object> exports(try_parse(parsed_arg)->ToObject());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
Local<Object> Value::ToObject() const {
^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE parse_cert(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:157:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local<Object> exports(try_parse(parsed_arg)->ToObject());
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
Local<Object> Value::ToObject() const {
^
../src/x509.cc: In function 'v8::Local<v8::Value> try_parse(const string&)':
../src/x509.cc:398:38: warning: value computed is not used [-Wunused-value]
BIO_set_close(ext_bio, BIO_CLOSE);
^
../src/x509.cc: In function 'v8::Local<v8::Value> parse_date(ASN1_TIME*)':
../src/x509.cc:462:75: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Nan::New<String>("Date").ToLocalChecked()).ToLocalChecked()->ToObject();
^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
from ../include/addon.h:4,
from ../include/x509.h:5,
from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
Local<Object> Value::ToObject() const {
^
SOLINK_MODULE(target) Release/obj.target/x509.node
COPY Release/x509.node
make: Leaving directory '/chaincode/output/node_modules/x509/build'
> grpc#1.10.1 install /chaincode/output/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v67-linux-x64-glibc.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.10.1 and node#11.10.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc#1.10.1 and node#11.10.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
make: Entering directory '/chaincode/output/node_modules/grpc/build'
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
make: Entering directory '/chaincode/output/node_modules/grpc/build'
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
rm: cannot remove './Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o.d.raw': No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o] Error 1
grpc.target.mk:388: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o' failed
make: Leaving directory '/chaincode/output/node_modules/grpc/build'
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/chaincode/output/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc"
gyp ERR! cwd /chaincode/output/node_modules/grpc
gyp ERR! node -v v11.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/chaincode/output/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/chaincode/output/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:984:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Linux 4.9.125-linuxkit
node-pre-gyp ERR! command "/chaincode/output/node_modules/node/bin/node" "/chaincode/output/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /chaincode/output/node_modules/grpc
node-pre-gyp ERR! node -v v11.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute '/chaincode/output/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc' (1)
../deps/grpc/src/core/lib/backoff/backoff.cc:76:1: fatal error: opening dependency file ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o.d.raw: No such file or directory
compilation terminated.
grpc.target.mk:388: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o' failed
make: Leaving directory '/chaincode/output/node_modules/grpc/build'
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/chaincode/output/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc"
gyp ERR! cwd /chaincode/output/node_modules/grpc
gyp ERR! node -v v11.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN The package composer-common is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.10.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-02-22T21_16_38_589Z-debug.log
"
Command failed
I feel like I'm close and all it takes is a minor fix, but I'm not sure.

Seems the problem is the npm version. When the chaincode container start for the first time, the peer node use npm install to download and install the dependencies of the smart contract inside the container (like fabric-shim). Try upgrating your npm version:
npm i npm#latest -g

Related

Cannot install opencv4nodejs using npm i -g opencv4nodejs on Mac OS 12.1 with Intel

ARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md
When I ran Appium doctor - I got the output above.
When I try to install - the error is: /usr/local/lib/node_modules/opencv4nodejs/install/install.js:37
npm ERR! throw new Error('library dir does not exist: ' + libDir)
npm ERR! ^
npm ERR!
npm ERR! Error: library dir does not exist: /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/lib
npm ERR! at Object. (/usr/local/lib/node_modules/opencv4nodejs/install/install.js:37:9)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1097:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:975:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
npm ERR! at node:internal/main/run_main_module:17:47
npm ERR!
npm ERR! Node.js v17.4.0
My node version is 17.4.0; I have tried switching to version 14 and that did not work.
I have also uninstalled node an reinstalled - that did not work. The same was done for npm. How can I get this installed? Is it still needed to automate my tests on the simulator?

yarn install --check-files giving me error output that I don't understand

I have a Ruby on Rails project that I'm deploying on a freshly set up server.
I run the command rails s -b 0.0.0.0 and it says:
========================================
Your Yarn packages are out of date!
Please run `yarn install --check-files` to update.
========================================
So I run the command it tells me to run, and ultimately it fails with a few errors that I don't really understand:
g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/home/ubuntu/.node-gyp/16.0.0/include/node -I/home/ubuntu/.node-gyp/16.0.0/src -I/home/ubuntu/.node-gyp/16.0.0/deps/openssl/config -I/home/ubuntu/.node-gyp/16.0.0/deps/openssl/openssl/include -I/home/ubuntu/.node-gyp/16.0.0/deps/uv/include -I/home/ubuntu/.node-gyp/16.0.0/deps/zlib -I/home/ubuntu/.node-gyp/16.0.0/deps/v8/include -I../../nan -I../src/libsass/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
In file included from /home/ubuntu/.node-gyp/16.0.0/include/node/v8.h:30,
from /home/ubuntu/.node-gyp/16.0.0/include/node/node.h:63,
from ../../nan/nan.h:56,
from ../src/binding.cpp:1:
/home/ubuntu/.node-gyp/16.0.0/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
/home/ubuntu/.node-gyp/16.0.0/include/node/v8-internal.h:452:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
| ^~~~~~~~~~~
| remove_cv
/home/ubuntu/.node-gyp/16.0.0/include/node/v8-internal.h:452:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
| ^~~~~~~~~~~
| remove_cv
/home/ubuntu/.node-gyp/16.0.0/include/node/v8-internal.h:452:50: error: template argument 2 is invalid
452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
| ^
/home/ubuntu/.node-gyp/16.0.0/include/node/v8-internal.h:452:63: error: ‘::Perform’ has not been declared
452 | !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
| ^~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:284:98: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
284 | int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
| ^~~~~~~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:320:98: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
320 | int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
| ^~~~~~~~~~~~
In file included from ../../nan/nan.h:56,
from ../src/binding.cpp:1:
../src/binding.cpp: At global scope:
/home/ubuntu/.node-gyp/16.0.0/include/node/node.h:806:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
806 | (node::addon_register_func) (regfunc), \
| ^
/home/ubuntu/.node-gyp/16.0.0/include/node/node.h:840:3: note: in expansion of macro ‘NODE_MODULE_X’
840 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
| ^~~~~~~~~~~~~
../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
358 | NODE_MODULE(binding, RegisterModule);
| ^~~~~~~~~~~
make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ubuntu/vendsmartsolutions/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:365:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 5.4.0-1038-aws
gyp ERR! command "/home/ubuntu/.nvm/versions/node/v16.0.0/bin/node" "/home/ubuntu/vendsmartsolutions/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/ubuntu/vendsmartsolutions/node_modules/node-sass
gyp ERR! node -v v16.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
make: Leaving directory '/home/ubuntu/vendsmartsolutions/node_modules/node-sass/build'
Build failed with error code: 1
I looked it over several times and I really have no idea what any of it means. This project runs fine on my development VM.
Any help would be appreciated, thanks.
It seems like the problem with the version of nodeJS.
I tried node v15 and it works for me, while v16 would fail.
Also, node-sass is deprecated. You should change another library to use.
UPDATE: this is what solved for me and #S.Goswami. Please try that solution first.
If the above solution doesn't work, it might be worth trying what is recommended here, but unfortunately that didn't work for me, or for others, but it could be worth a try if the above solution doesn't work. Here's an outline of the solution that worked for some, but not everyone:
Delete yarn.lock
There's a directory in the root of your rails app called node_modules - delete it. NOTE: if you use sublime text, it won't show directories that simply "house source control information and various binary output files" (lesson learned). Open your app in finder, find yourapp/node_modules/ and delete it.
Run spring stop (I didn't need to do this, but others have recommended it, and it won't hurt).
Now simply reinstall your node modules with yarn install. But, if this step errors, try using yarn install -std=c++17 as found in the help from the comments and #Scheff's answer
node-sass doesn't support Node v16 yet. So for now downgrade Node to v15 will fix these errors. For further updates visit sass/node-sass#3077

npm run migrate asking for password

I'm running into a wall when it comes to migrating to databases. For some reason whenever I try to migrate git bash asks me for a password. A password I never had to enter before.
I don't know what this password could be. I tried my desktop password but that gives me the same error as if I put nothing at all.
$ npm run migrate
express-boilerplate#0.0.1 migrate C:\Users\Zackr\Documents\node\node-todo-get-post
postgrator --config postgrator-config.js
Password:
C:\Users\Zackr\Documents\node\node-todo-get-post\node_modules\postgrator-cli\postgrator-cli.js:187
rl.history = rl.history.slice(1);
^
TypeError: Cannot read property 'slice' of undefined
at C:\Users\Zackr\Documents\node\node-todo-get-post\node_modules\postgrator-cli\postgrator-cli.js:187:33
at Interface._onLine (readline.js:335:5)
at Interface._normalWrite (readline.js:482:12)
at Socket.ondata (readline.js:194:10)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:188:23) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR!
express-boilerplate#0.0.1 migrate: postgrator --config postgrator-config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the express-boilerplate#0.0.1 migrate script. npm ERR! This is
probably not a problem with npm. There is likely additional logging
output above.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Zackr\AppData\Roaming\npm-cache_logs\2021-02-17T21_50_59_429Z-debug.log
Didn't realize that the new version of postgrator-cli requires a password. I rolled back to an earlier version.

electron-windows-store return error: unknown option `--flatten'

I have tried to make desktop exe for window using electron. I have run below command to generate sign version of exe:
electron-windows-store --input-directory .\\desktop\\dist\\win-unpacked --output-directory .\\desktop\\store --flatten true -a .\\resources\\desktop -m .\\desktop\\assets\\windows\\AppXManifest.xml --package-version 0.0.0.1 --package-name MoodleDesktop
But it give me below error:
> moodledesktop#3.5.1 windows.store D:\wamp64\www\moodle-desktop
> electron-windows-store --input-directory .\desktop\dist\win-unpacked --output-directory .\desktop\store --flatten true -a .\resources\desktop -m .\desktop\assets\windows\AppXManifest.xml --package-version 0.0.0.1 --package-name MoodleDesktop
You need at least Node 4.x to run this script
error: unknown option `--flatten'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! moodledesktop#3.5.1 windows.store: `electron-windows-store --input-directory .\desktop\dist\win-unpacked --output-directory .\desktop\store --flatten true -a .\resources\desktop -m .\desktop\assets\windows\AppXManifest.xml --package-version 0.0.0.1 --package-name VedificDesktop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the moodledesktop#3.5.1 windows.store script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\prawez.musharraf\AppData\Roaming\npm-cache\_logs\2019-02-12T09_50_34_214Z-debug.log
How we resolve this error??
Any help really appriciated.
as from sep 2018 the option flatten been removed
https://github.com/felixrieseberg/electron-windows-store/commit/dcc654df2ec2bb706dc4f1664aa4775ab320541e
that mean just remove it from the command and everything going to be okay!

rails-react-boilerplate: Webpack not compiling

Introduction
I trying to run rails-react-boilerplate, everything goes fine, but at the end of installation (bundle install, yarn install, rake db:create ..), command with webpack simple not working. There is a link on github repository: rails-react-boilerplate.
Error
After this command npm run webpack I get this error:
openssl config failed: error:02001003:system library:fopen:No such process
> rails-react-boilerplate#1.0.0 webpack D:\code\portfolio\liftProgress
> ./node_modules/webpack/bin/webpack.js --progress --colors
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rails-react-boilerplate#1.0.0 webpack:
`./node_modules/webpack/bin/webp
ack.js --progress --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rails-react-boilerplate#1.0.0 webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Derid\AppData\Roaming\npm-cache\_logs\2017-12-
30T07_27_37_
058Z-debug.log
openssl config failed: error:02001003:system library:fopen:No such process
where I think main problem is:
'.' is not recognized as an internal or external command,
operable program or batch file.
.. but I am at one's wits' end .. very thanks for your guidance and help!:)
This is a Windows issue, you can try omitting the ./ from the actual command on the package.json file.
Actually after doing some research, including the node executable should work cross-platform:
"webpack": "node node_modules/webpack/bin/webpack.js --progress --colors",

Resources