Hyperledger Composer Installation - installation

I have tried installed hyper ledger composer CLI & its development tools but got errors. like the
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated constantinople#3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated nodemailer#2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated socks#1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated mailcomposer#4.0.1: This project is unmaintained
npm WARN deprecated buildmail#4.0.1: This project is unmaintained
/root/.nvm/versions/node/v8.10.0/bin/composer -> /root/.nvm/versions/node/v8.10.0/lib/node_modules/composer-cli/cli.js
pkcs11js#1.0.14 install /root/.nvm/versions/node/v8.10.0/lib/node_modules/composer-cli/node_modules/pkcs11js
node-gyp rebuild
sh: 1: node-gyp: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! pkcs11js#1.0.14 install: node-gyp rebuild
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.14 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/2018-03-24T02_16_27_676Z-debug.log
root#Composer:~# npm install -g composer-rest-server
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated constantinople#3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated nodemailer#2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated mailcomposer#4.0.1: This project is unmaintained
npm WARN deprecated socks#1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated buildmail#4.0.1: This project is unmaintained
/root/.nvm/versions/node/v8.10.0/bin/composer-rest-server -> /root/.nvm/versions/node/v8.10.0/lib/node_modules/composer-rest-server/cli.js
pkcs11js#1.0.14 install /root/.nvm/versions/node/v8.10.0/lib/node_modules/composer-rest-server/node_modules/pkcs11js
node-gyp rebuild
sh: 1: node-gyp: Permission denied
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! pkcs11js#1.0.14 install: node-gyp rebuild
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.14 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/2018-03-24T02_16_58_032Z-debug.log
root#Composer:~# npm install -g generator-hyperledger-composer
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated formatio#1.2.0: This package is unmaintained. Use #sinonjs/formatio instead
pkcs11js#1.0.14 install /root/.nvm/versions/node/v8.10.0/lib/node_modules/generator-hyperledger-composer/node_modules/pkcs11js
node-gyp rebuild
sh: 1: node-gyp: Permission denied
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! pkcs11js#1.0.14 install: node-gyp rebuild
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.14 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/2018-03-24T02_17_21_569Z-debug.log
Whats the best way or single line command to install the composer on ubuntu ?
the i tried to install the cli as sudo user : got this error :
i tried to install the composer cli as sudo user: got this : "swap#composer:~$ npm install -g composer-cli
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated constantinople#3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated nodemailer#2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated socks#1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated mailcomposer#4.0.1: This project is unmaintained
npm WARN deprecated buildmail#4.0.1: This project is unmaintained
/home/swap/.nvm/versions/node/v8.10.0/bin/composer -> /home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/composer-cli/cli.js
pkcs11js#1.0.14 install /home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/composer-cli/node_modules/pkcs11js
node-gyp rebuild
Traceback (most recent call last):
File "/home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/gyp/gyp_main.py", line 13, in
import gyp
File "/home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 8, in
import gyp.input
File "/home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 5, in
from compiler.ast import Const
ImportError: No module named compiler.ast
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.4.0-109-generic
gyp ERR! command "/home/swap/.nvm/versions/node/v8.10.0/bin/node" "/home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/swap/.nvm/versions/node/v8.10.0/lib/node_modules/composer-cli/node_modules/pkcs11js
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkcs11js#1.0.14 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.14 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
"
please guide

I would run a npm update and take a look at this two links:
https://hyperledger.github.io/composer/installing/installing-prereqs
and
https://hyperledger.github.io/composer/reference/commands.html
Read with care about the requisites.
And I also notice the information:
Please note: When using Ubuntu this command will fail when running in a root user shell.

Related

Github action: npm install -> Error: Process completed with exit code 1

I have this GitHub action workflow that have been working for over a year. Suddenly I get error when I get to the step that runs 'npm install'. I really have no clue why the error is triggered. Would really appreciate someone helping or at least just pointing me in right direction. If you need some more data just tell me I will edit the question.
I have tried updating some packages and also the npm update command. But no good:
Run npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
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 core-js#2.6.12: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! make: Entering directory '/home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-sass/build'
npm ERR! g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-
(some more error message in between here but had to cut off due to too many characters)
npm ERR! remove_cv
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: note: suggested alternative: ‘remove_cv’
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:50: error: template argument 2 is invalid
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: error: ‘::Perform’ has not been declared
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: note: suggested alternative: ‘herror’
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~
npm ERR! herror
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.0-1064-azure
npm ERR! gyp ERR! command "/usr/local/bin/node" "/home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-13T20_05_37_396Z-debug.log
Error: Process completed with exit code 1.
It looks like something in your project is using node-sass, which contains libsass which is deprecated
If it is a direct dependency, you can just switch over to Dart Sass, and things mostly should just work the same. If it is a transitive dependency that is requiring node-sass, you can try to update it by updating your direct dependencies that depend on it. Alternatively, if you're using yarn, you can try to change it with selective version resolutions
If you couldn't manage to switch to using dart-sass and have to deal with the C++ gyp build error, I would probably check to make sure that the particular version of node-sass you're using is compatible with the current c++ compiler you currently have installed. Maybe your compiler became too old because libsass (and in turn, node-sass) decided to up their language requirements?
Edit:
Try using this technique (since you are using npm) for resolving the node-sass that is inside vue-mj-daterangepicker to something else. You can change to a newer version or by using the "dart-sass" package. If you use the latter, g++ wouldn't error since dart-sass doesn't use c++. You could also use the "sass" package, since the sass and dart-sass npm pacakges are essentially the same
Maybe something like the following in your package.json... (not tested)
"resolutions": {
"node-sass": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.0.tgz"
},
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
or
"resolutions": {
"node-sass": "https://registry.npmjs.org/dart-sass/-/dart-sass-1.25.0.tgz"
},
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
The reason that this is happening is because libsass seems to be set up to use the C++11 standard when it builds, but std::remove_cv_t was only introduced as part of the C++14 standard (I think some compilers like MSVC may have introduced it earlier than that). An easy fix is to set the CXXFLAGS environment variable before you run npm install. e.g. CXXFLAGS="--std=c++14" npm install

Package cairo not found in pakg-config search path

sachin#sachin-Inspiron-15-3567:~/Desktop/Projects/api.ohphish.com$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but npm-shrinkwrap.json was generated for lockfileVersion#0. I'll try to do my best with it!
canvas#1.6.13 install /home/sachin/Desktop/Projects/api.ohphish.com/node_modules/chartjs-node/node_modules/canvas
node-gyp rebuild
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing cairo.pc' to the PKG_CONFIG_PATH environment variable No package 'cairo' found gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.4.0-42-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/sachin/Desktop/Projects/api.ohphish.com/node_modules/chartjs-node/node_modules/canvas
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN chartjs-node#1.7.1 requires a peer of chart.js#<=2.7.* but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas#1.6.13 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#1.6.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I installed dev dependencies by issueing command.
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev build-essential

when i am trying to install npm install gulp -D in cmd prompt there many errors displaying

node verison:v12.4.0
npm verison:6.13.4
laravel:5.8
Build failed with error code: 1
npm WARN The package popper.js is included as both a dev and production depende
cy.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\fs
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents
1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"
)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional lo
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\CLOUD TIMON\AppData\Roaming\npm-cache_logs\2019-12-31T05
00_45_654Z-debug.log
first try to clean npm cache with :
npm cache clean --force
then delete node_modules folder completely, then again run npm install.
that should solve the problem.

npm install error - SKIPPING OPTIONAL DEPENDENCY

I'm trying to follow an online course of laravel with laragon. I need to run the command npm install, but it marks an error and I don't know how to fix it.
I tried to modify the path but that did not work
C:\laragon\www\social>npm install
"CALL "C:\laragon\nodejs\\node.exe" "C:\laragon\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
> node-sass#4.11.0 install C:\laragon\www\social\node_modules\node-sass
> node scripts/install.js
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN img-loader#3.0.1 requires a peer of imagemin#^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
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":"win32","arch":"x64"})
npm ERR! file C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm
npm ERR! path C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm
npm ERR! node-sass#4.11.0 install: `node scripts/install.js`
npm ERR! spawn C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm ENOENT
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 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! C:\Users\Caribay\AppData\Roaming\npm-cache\_logs\2019-01-22T03_32_49_327Z-debug.log
I hope with this command works correctly but it marks these errors, help me, please
P.S: I work on a laptop with windows 7 home premium.
$ npm cache clean --force
delete node_modules by $ rm -rf node_modules
$ npm install
And then start it again with $ npm start
I think you should install manually ajv package or update it to version 6.0 if you already have a lower version
npm i ajv
i had a similar issue. after updating it works fine. Try doing same for other errors also.

OS X cannot install ember-cli at all

after many tries , I am not far for giving up with ember testing ...
1/ I get npm ERR! registry error parsing son
2/ then I get nexpected end of input
node -v
v4.2.6
nam -v
2.14.12
npm install -g ember-cli
npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ember-cli"
npm ERR! node v4.2.6
npm ERR! nam v2.14.12
npm ERR! Unexpected end of input
... long JSON object ..
Finally got it installed by running before :
npm config set registry http://registry.npmjs.org
Then
$ npm install -g ember-cli#latest
installation ended correctly , beside the "standard" loads deprecated...
npm WARN deprecated lodash#2.4.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0
npm WARN deprecated lodash-node#2.4.1: This package has been discontinued in favor of lodash#^4.0.0
npm WARN deprecated lodash-node#3.10.2: This package has been discontinued in favor of lodash#^4.0.0
/Users/yves/.node/bin/ember -> /Users/yves/.node/lib/node_modules/ember-cli/bin/ember

Resources