Fabric Composer bna build errors - hyperledger-composer

Since moving to v0.10.x, which removed use of 'bnabuild', I'm having trouble trying to build my bna locally using 'npm install'. I'm running HLF V1.0, node v6.9.5, and npm v3.10.10. There's likely something wrong in the model that has changed since moving to v0.10.x but I cannot figure out what it is from the sparse log information. I've added the model file and js to an empty playground, but no errors are uncovered. I even tried opening directory and file permissions.
Error is:
"npm ERR! argv "/Users/guyho/.nvm/versions/node/v6.9.5/bin/node" "/Users/guyho/.nvm/versions/node/v6.9.5/bin/npm" "install"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! petchain-network#0.0.10 prepublish: mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/petchain-network.bna
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the petchain-network#0.0.10 prepublish script 'mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/petchain-network.bna'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the petchain-network package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/petchain-network.bna"

Related

Errors on "npm run dev" (after Laravel clean install)

I'm very excited to learn Laravel and create a webapp based on a bootstrap template I bought (OneUI). I successfully installed Laravel (the /public route returns the default view to my browser correctly). Now i'm following the install guide of the template, and i'm experiencing problems with npm commands that return errors that I can't understand (I'm not familiar with npm).
I'd really appreciate if somebody could help me to find what's wrong so I could finally using Laravel with the Templates.
As requested in the OneUI documentation, i copy the public & resources folders, the routes/web.php file, and the webpack.mix.js file. Then, i install the npm dependencies running the following command :
npm i browser-sync browser-sync-webpack-plugin sass sass-loader bootstrap#^4.5.3 jquery#^3.5.1 jquery-scroll-lock#^3.1.3 jquery.appear#^1.0.1 js-cookie#^2.2.1 popper.js#^1.16.1 simplebar#^5.3.0 -D
This seems to run OK with a few warnings about some deprecated packages.
Then i run :
npm run dev
I get this return :
> # dev /volume1/web/dev/myproject
> npm run development
> # development /volume1/web/dev/myproject
> mix
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn npx ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn npx',
path: 'npx',
spawnargs: [
'webpack',
'--progress',
'--config=node_modules/laravel-mix/setup/webpack.config.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development 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! /var/services/homes/admin/.npm/_logs/2021-01-25T22_32_54_150Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev 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! /var/services/homes/admin/.npm/_logs/2021-01-25T22_32_54_340Z-debug.log
This is on Linux, directly on my Synology (I don't use anything like a VM/Docker).
To install Laravel, I simply did this :
Installed php7.4 + libraries
Installed composer
Went into my web folder and entered the command : composer create-project laravel/laravel myproject
Added write access to my http user on the storage folder
I tryied this already without success :
As advised on other websites:
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
npm run dev
I tryied to do a npm install and npm run dev on a clean Laravel Install (before the install of all the packages required by the OneUI templates) to try to see if it's related to the OneUI files or the npm dependencies I installed. I have the same errors. So I understand it's not related to the OneUI install, but an issue with npm / my Laravel files (?).
In advance, thanks a lot for your help !

Angularfire2 SSR: firebase function build error

I'm trying to build an SSR for my application, I follow the documentation Angularfire2 and everything is going great. Until now when I try to create a function for firebase hosting. I have a problem with the script rm -r ./dist && cp -r ./dist . && tsc. At npm run build throws error:
rm: cannot remove './dist': No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions# build: rm -r ./dist && cp -r ./dist . && tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions# build 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\marti\AppData\Roaming\npm-cache_logs\2019-08-27T17_27_06_264Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! carsgram#0.0.0 build:functions: npm run --prefix functions build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the carsgram#0.0.0 build:functions 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\marti\AppData\Roaming\npm-cache_logs\2019-08-27T17_27_06_371Z-debug.log
Any idea what causes it?

Sails.js won't install. Windows

Sails.js will not install, but just to make sure npm is working I installed grunt
npm install -g grunt-cli and it installed correctly.
But when I run npm install -g sails I get an error.
Command prompt error:
`sails#0.11.0 preinstall C:\Users\User\AppData\Roaming\npm\node_modules\sails
node ./lib/preinstall_npmcheck.js
Sails.js Installation - Error
Unable to check your npm-version
Please reinstall npm to use Sails.js
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-
cli.js" "-g" "install" "sails"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! sails#0.11.0 preinstall: node ./lib/preinstall_npmcheck.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sails#0.11.0 preinstall script 'node ./lib/preinstall_npmcheck.js'.
npm ERR! This is most likely a problem with the sails package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/preinstall_npmcheck.js
npm ERR! You can get their info via:
npm ERR! npm owner ls sails
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log`
npm-debug.log:
https://gist.github.com/anonymous/c850ac8c71e0410db020
I got the same errors.
npm -g install sails
But it worked when I ran command line as administrator.
I solved this by running npm install -g sails --ignore-scripts.
The only thing I can think of is for some reason I don't have ./lib/preinstall_npmcheck.js file and it is trying to run it, so by ignoring it I don't get the error, hence the successful install.
I still don't understand why, but I hope this helps someone.

Can't npm install dependencies when building docker image

I'm building an image from a Dockerfile and the part where I npm install the dependencies is erroring when I build the image, but I can run the commands outside of it. I don't know exactly where this error is coming from.
I'm using boot2docker on Windows and my Dockerfile is:
FROM ubuntu:15.04
RUN apt-get -y update
RUN apt-get -y install nodejs
RUN apt-get -y install npm
COPY /server /src
COPY /server/package.json /tmp/package.json
RUN cd /tmp && npm install
(etc)
The error message is:
sh:1 node: not found
npm WARN: This failure might be due to the use of legacy binary "node"
npm WARN: For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! sails#0.11.0 preinstall: 'node ./lib/preinstall_npmcheck.js'
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the sails#0.11.0 preinstall script.
npm ERR! This is most likely a problem iwth the sails package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/preinstall_npmcheck.js
npm ERR! You can get their info via:
npm ERR! npm owner ls sails
npm ERR! There is additional logging output above.
npm ERR! System Linux 4.0.3-boot2docker
npm ERR! command "usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm-debug.log
npm ERR! not ok code 0
INFO[0633] THe command [/bin/sh -c cd /tmp && install] returned a non-zero code: 1
Although it says it's probably a problem with Sails, I have no problem installing it on my machine. I can't install it when I run the image (obviously), and when I try to just run the ubuntu:15.04 image and install npm and Sails there, it tells me that npm is a command not found.
I'm still new to Docker (and to Windows-- I can't even find the npm-debug.log) so any type of advice helps a lot.
Thank you!
It's a problem of nodejs installation which was covered here: what are the differences between node.js and node?
Breifly, there are three options to fix this: creating symlink yourself, using nvm, or installing nodejs-legacy instead of nodejs:
RUN apt-get -y install nodejs-legacy

Mac npm erroring with ENOENT

I'm a recent convert to Mac from Windows, and currently just trying to get my tools setup.
I first installed node using homebrew, which was giving me errors (same as what I still have). I later removed node using homebrew and installed using the pkg from the node website.
I can access node in the command line and npm. The problem is when I try to install modules on the project locally I get something like:
npm install grunt-contrib
Error extracting archive { [Error: ENOENT, open '/Users/davidmckeown/dev/adt-com/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip']
errno: 34,
code: 'ENOENT',
path: '/Users/davidmckeown/dev/adt-com/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/tmp/phantomjs-1.7.0-macosx.zip' }
Another message just above that contains:
npm ERR! phantomjs#0.2.6 install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 8
npm ERR!
npm ERR! Failed at the phantomjs#0.2.6 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.2.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "grunt-contrib"
npm ERR! cwd /Users/davidmckeown/dev/adt-com
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
Any help figuring out what is causing problems here would be fantastic. This happens with other modules too, from what I can tell.
npm cache clean
or if installed under su
sudo npm cache clean
There was an issue 5 months ago with grunt qunit package - https://github.com/gruntjs/grunt-lib-phantomjs/issues/5.
Try to install this specific package:
sudo npm install grunt-contrib-qunit
The package that you installed is a bundle of many packages. The qunit package version was not updated explicitly to the latest version in this bundle, that's why clearing the npm cache might solve this issue.

Resources