Unable to install composer-cli - hyperledger-composer

I am unable to npm install -g composer-cli on MacOS 10.12.5. As Dan pointed out, initially I was using an unsupported version of npm but I installed npm v 3.10.10 which is supported and now I receive the following error message:
As Dan suggested, I installed npm 3.10.10 and tried the install again but it again fails but with a new message:
Tims-MacBook-Pro:fabric-tools timolson$ npm install -g composer-cli
Error: Cannot find module 'safe-buffer'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/lib/helpers.js:5:36)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "composer-cli"
npm ERR! node v6.9.2
npm ERR! npm v3.10.10
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'safe-buffer'
I had it installed previously while running HLF v.6 but I am trying to use HLF 1 Beta and saw a note that I needed to be using a version of composer later than 8.0 (I was running version 7.? prior). So I uninstalled composer-cli and haven't been able to re-install it.

You are using npm version 5, which Composer does not yet support. Please try with a supported version of npm. See https://hyperledger.github.io/composer/installing/development-tools.html for the supported operating environment.

Related

npm installation and npm dev for laravel not working

Good day everybody,
[Please I am NOT dumping code/error here I am not sure what information may be required by anyone who wants to help, which the reason why I have to provide all information which I believe may be important/neccessary and also I do not know where else I can put the detailed information in]
After installing laravel it was showing the error in the webpage that app.css, app.js were not found
Then I ran the command
npm install && npm run dev
This gave me the result
npm WARN deprecated axios#0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.3.1 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN sass-loader#8.0.2 requires a peer of node-sass#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader#8.0.2 requires a peer of fibers#>= 3.1.0 but none is installed. You must install peer dependencies yourself.
added 1094 packages from 506 contributors and audited 1097 packages in 917.337s
found 2 high severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
> # dev C:\laravel_directory
> npm run development
> # development C:\laravel_directory
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
C:\laravel_directory\node_modules\webpack-cli\bin\cli.js:93
throw err;
^
AssertionError [ERR_ASSERTION]: mix.js() is missing required parameter 1: entry
at Function.js (C:\laravel_directory\node_modules\laravel-mix\src\Assert.js:13:9)
at JavaScript.register (C:\laravel_directory\node_modules\laravel-mix\src\components\JavaScript.js:40:16)
at Api.mix.(anonymous function).args [as vue] (C:\laravel_directory\node_modules\laravel-mix\src\components\ComponentFactory.js:98:53)
at Object.<anonymous> (C:\laravel_directory\webpack.mix.js:15:6)
at Module._compile (C:\laravel_directory\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (C:\laravel_directory\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object.<anonymous> (C:\laravel_directory\node_modules\laravel-mix\setup\webpack.config.js:12:1)
at Module._compile (C:\laravel_directory\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (C:\laravel_directory\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at WEBPACK_OPTIONS (C:\laravel_directory\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\laravel_directory\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\laravel_directory\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\laravel_directory\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at yargs.parse (C:\laravel_directory\node_modules\webpack-cli\bin\cli.js:71:45)
at Object.parse (C:\laravel_directory\node_modules\webpack-cli\node_modules\yargs\yargs.js:576:18)
at C:\laravel_directory\node_modules\webpack-cli\bin\cli.js:49:8
at Object.<anonymous> (C:\laravel_directory\node_modules\webpack-cli\bin\cli.js:366:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\laravel_directory\node_modules\webpack\bin\webpack.js:156:2)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
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! C:\Users\AppData\Roaming\npm-cache\_logs\2021-01-14T03_38_32_222Z-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! C:\Users\AppData\Roaming\npm-cache\_logs\2021-01-14T03_38_32_412Z-debug.log
Please what am I supposed to do to be able to have the installation working as it is supposed to.
I've faced same error on laravel 8 when installing vue on it.
It's actually adding content in webpack.mix.js file like vue().
replace vue() to the following:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
then run npm run watch
Delete your node_module folder and then again run the command.

MacOS: How to install puppeteer with or without Chromium?

I am trying to install puppeteer globally on macOS (Mojave) 10.14.3
First failure (in sudo su mode): npm install -g puppeteer
> puppeteer#1.12.2 install /usr/local/lib/node_modules/puppeteer
> node install.js
ERROR: Failed to download Chromium r624492! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/puppeteer/.local-chromium'
-- ASYNC --
at BrowserFetcher.<anonymous> (/usr/local/lib/node_modules/puppeteer/lib/helper.js:108:27)
at Object.<anonymous> (/usr/local/lib/node_modules/puppeteer/install.js:64:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/local/lib/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer#1.12.2 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer#1.12.2 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! /var/root/.npm/_logs/2019-02-27T14_04_04_609Z-debug.log
Second failure: I successfully installed manually Chromium from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/635943/ and then (in sudo su mode):
npm get | grep PUPPETEER
PUPPETEER_EXECUTABLE_PATH = "/Applications/Chromium.app/Contents/MacOS/Chromium"
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = true
PUPPETEER_EXECUTABLE_PATH = "/Applications/Chromium.app/Contents/MacOS/Chromium"
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = true
npm install -g puppeteer
> puppeteer#1.12.2 install /usr/local/lib/node_modules/puppeteer
> node install.js
ERROR: Failed to download Chromium r624492! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/puppeteer/.local-chromium'
-- ASYNC --
at BrowserFetcher.<anonymous> (/usr/local/lib/node_modules/puppeteer/lib/helper.js:108:27)
at Object.<anonymous> (/usr/local/lib/node_modules/puppeteer/install.js:64:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/local/lib/node_modules/puppeteer/.local-chromium' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer#1.12.2 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer#1.12.2 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! /var/root/.npm/_logs/2019-02-27T14_07_19_001Z-debug.log
What am I doing wrong here?
Try with it:
npm config set user 0
npm config set unsafe-perm true
npm install -g puppeteer
Option unsafe-perm:
Set to true to suppress the UID/GID switching when running package
scripts. If set explicitly to false, then installing as a non-root
user will fail.
If npm was invoked with root privileges, then it will change the uid
to the user account or uid specified by the user config, which
defaults to nobody. Set the unsafe-perm flag to run scripts with root
privileges.
This was working fine for me a matter of days ago, but am not getting exactly the same error

Error: Cannot find module './Assert' When Running npm run watch with Laravel

I randomly started getting this error message when I try to run npm run watch. I don't know what I did that would cause it to have an error since I never touched any of the files related to laravel-mix.
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
module.js:549
throw err;
^
Error: Cannot find module './Assert'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/node_modules/laravel-mix/src/Api.js:1:76)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`
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.
Tried running npm update and npm install to get the latest files but it didn't help.
I even tried manually adding the Assert.js file, but I kept getting new errors with each one that I fixed. There must be a better solution.
I deleted laravel-mix from node_modules and ran npm install again and it changed my error to:
Error: Cannot find module './transform'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/node_modules/ajv-keywords/keywords/index.js:18:14)
Ended up getting npm run watch to work by deleting the node_modules directory and running npm install to get all files fresh. Not sure why I had to delete the node_modules folder to get the fresh files, but at least its working.

Error when running npm start: nvm is not compatible with the "npm_config_prefix" environment variable

I am working on a project which I use nvm.
Out of nowhere, I started to get this error when running "npm start":
npm start
> sh ./bin/start.sh
nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/Users/user/.nvm/versions/node/v8.9.4"
Run `unset npm_config_prefix` to unset it.
Found '/Users/user/project/project/.nvmrc' with version <8.9.0>
nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/Users/user/.nvm/versions/node/v8.9.4"
Run `unset npm_config_prefix` to unset it.
/Users/user/project/project/node_modules/node-sass/lib/binding.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding /Users/user/project/project/node_modules/node-sass/vendor/darwin-x64-59/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 9.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 8.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
at module.exports (/Users/user/project/project/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/Users/user/project/project/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/user/project/project/node_modules/node-sass/bin/node-sass:10:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #namespace/project#5.14.1 start: `sh ./bin/start.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #namespace/project#5.14.1 start 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! /Users/user/.npm/_logs/2018-06-19T19_30_15_079Z-debug.log
I have already tried the following actions with no success:
1) Delete the repo, clone it again and run npm install
2) Update npm
3) Delete nvm folder and download it again
4) Run unset npm_config_prefix
5) Run npm rebuild node-sass --force
Obs.: I use zsh terminal on a Mac OS 10.13.4
I ran nvm deactivate as suggested here and the error went away.
I only ran that command and none of the other ones.
If using nvm and not system node
Obviously one can add line
unset NPM_CONFIG_PREFIX
into a batch file. Or run it in terminal

Laravel npm install on OSX vagrant box gives node-sass error

My package.json file:
{
"private": true,
"devDependencies": {
"babel-polyfill": "^6.9.1",
"gulp": "*",
"laravel-elixir-browsersync2": "*",
"laravel-elixir-vueify": "1.0.3"
},
"dependencies": {
"bootstrap-sass": "*",
"laravel-elixir": "5.0.0"
}
}
I try to do a npm install and I get an error. That seems to be related with node-sass.
Here's the error log:
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated node-uuid#1.4.7: use uuid module instead
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN prefer global coffee-script#1.12.1 should be installed with -g
npm WARN prefer global marked#0.3.6 should be installed with -g
npm WARN prefer global node-gyp#3.4.0 should be installed with -g
> node-sass#3.13.0 install /var/www/html/vm.laravel.bng.dev/node_modules/node-sass
> node scripts/install.js
/var/www/html/vm.laravel.bng.dev/node_modules/tough-cookie/lib/pubsuffix.js:96
{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"cr
SyntaxError: Invalid or unexpected token
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/www/html/vm.laravel.bng.dev/node_modules/tough-cookie/lib/cookie.js:34:17)
at Module._compile (module.js:570:32)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/gulp-watch/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN Error: EPERM: operation not permitted, scandir '/var/www/html/vm.laravel.bng.dev/node_modules/cross-spawn/node_modules'
npm WARN at Error (native)
npm WARN { Error: EPERM: operation not permitted, scandir '/var/www/html/vm.laravel.bng.dev/node_modules/cross-spawn/node_modules'
npm WARN at Error (native)
npm WARN errno: -1,
npm WARN code: 'EPERM',
npm WARN syscall: 'scandir',
npm WARN path: '/var/www/html/vm.laravel.bng.dev/node_modules/cross-spawn/node_modules' }
npm ERR! Linux 3.10.0-327.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.9.2
npm ERR! npm v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! node-sass#3.13.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.0 install script 'node scripts/install.js'.
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 node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/vm.laravel.bng.dev/npm-debug.log
From memory, you could try npm rebuild node-sass.
Also, if you may run into a problem with symlinks, try npm rebuild node --no-bin-links.
Disclaimer: not tested.

Resources