npm run dev causes errors on fresh laravel 5.6.x installation - npm-install

I'm busy learning Laravel and run into a problem when i want to run npm run dev
First some background information:
Laravel version 5.6.22
npm version 6.01
node version 8.10.0
OS Ubuntu 18.4 LTS
PHP 7.2.5
Composer v 1.6.3
Executed steps:
Created a new laravel project sudo composer create-project --prefer-dist laravel/laravel npmtest
Grant all permissions (i'm aware of the security risks with 777 but did this just to test) sudo chmod -R 777 /var/www/npmtest
did a sudo composer install in the project root
followed by sudo npm install (already some error noticed)
Result of sudo npm install
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
> node-sass#4.9.0 install /var/www/npmtest/node_modules/node-sass
> node scripts/install.js
Unable to save binary /var/www/npmtest/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/var/www/npmtest/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/var/www/npmtest/node_modules/mkdirp/index.js:71:13)
at Function.sync (/var/www/npmtest/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/var/www/npmtest/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/var/www/npmtest/node_modules/node-sass/scripts/install.js:157:1)
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)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/var/www/npmtest/node_modules/node-sass/vendor' }
> uglifyjs-webpack-plugin#0.4.6 postinstall /var/www/npmtest/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
> node-sass#4.9.0 postinstall /var/www/npmtest/node_modules/node-sass
> node scripts/build.js
Building: /usr/bin/node /var/www/npmtest/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli '/var/www/npmtest/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp#3.6.2
gyp info using node#8.10.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.15rc1\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.10.0
gyp verb command install [ '8.10.0' ]
gyp verb install input version string "8.10.0"
gyp verb install installing version: 8.10.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.10.0
gyp verb build dir attempting to create "build" dir: /var/www/npmtest/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/var/www/npmtest/node_modules/node-sass/build'
gyp ERR! System Linux 4.15.0-20-generic
gyp ERR! command "/usr/bin/node" "/var/www/npmtest/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/npmtest/node_modules/node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
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 optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 postinstall 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! /home/roge/.npm/_logs/2018-05-18T13_53_01_126Z-debug.log
As i had no idea what to do with the errors and noticed that some of them go over permissions and permissions of node-modules where not 777, probably because executing npm install as root, i did:
sudo chmod -R 777 /var/www/npmtest again
followed by sudo npm install again
Result:
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
> node-sass#4.9.0 install /var/www/npmtest/node_modules/node-sass
> node scripts/install.js
Unable to save binary /var/www/npmtest/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/var/www/npmtest/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/var/www/npmtest/node_modules/mkdirp/index.js:71:13)
at Function.sync (/var/www/npmtest/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/var/www/npmtest/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/var/www/npmtest/node_modules/node-sass/scripts/install.js:157:1)
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)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/var/www/npmtest/node_modules/node-sass/vendor' }
> uglifyjs-webpack-plugin#0.4.6 postinstall /var/www/npmtest/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
> node-sass#4.9.0 postinstall /var/www/npmtest/node_modules/node-sass
> node scripts/build.js
Building: /usr/bin/node /var/www/npmtest/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli '/var/www/npmtest/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp#3.6.2
gyp info using node#8.10.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.15rc1\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.10.0
gyp verb command install [ '8.10.0' ]
gyp verb install input version string "8.10.0"
gyp verb install installing version: 8.10.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.10.0
gyp verb build dir attempting to create "build" dir: /var/www/npmtest/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/var/www/npmtest/node_modules/node-sass/build'
gyp ERR! System Linux 4.15.0-20-generic
gyp ERR! command "/usr/bin/node" "/var/www/npmtest/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/npmtest/node_modules/node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
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 optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 postinstall 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! /home/roge/.npm/_logs/2018-05-18T13_53_01_126Z-debug.log
As i still could not find a solution for the errors, i tried to execute sudo npm run dev (and without sudo) what didn't work off course
result:
> # dev /var/www/npmtest
> npm run development
> # development /var/www/npmtest
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
module.js:549
throw err;
^
Error: Cannot find module '/var/www/npmtest/node_modules/laravel-mix/setup/webpack.config.js'
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 requireConfig (/var/www/npmtest/node_modules/webpack/bin/convert-argv.js:97:18)
at /var/www/npmtest/node_modules/webpack/bin/convert-argv.js:104:17
at Array.forEach (<anonymous>)
at module.exports (/var/www/npmtest/node_modules/webpack/bin/convert-argv.js:102:15)
at yargs.parse (/var/www/npmtest/node_modules/webpack/bin/webpack.js:171:41)
at Object.Yargs.self.parse (/var/www/npmtest/node_modules/yargs/yargs.js:533:18)
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! /home/roge/.npm/_logs/2018-05-18T14_01_02_924Z-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! /home/roge/.npm/_logs/2018-05-18T14_01_02_953Z-debug.log
After Google a few hours and trying:
https://github.com/JeffreyWay/laravel-mix/issues/533 and https://github.com/JeffreyWay/laravel-mix/issues/1072 and few more i have no idea where to continue.
For some magic reason is npm run dev working in one of my projects. Its the same Laravel version and i have really no idea what i did else there than in the (multiple) new projects i tried to get working...
Did i forget something or something wrong? Hope that someone can help me! Thanks in advance...

I solved the same problem
sudo apt-get install libpng-dev
npm install -g pngquant-bin

Related

I am getting NPM error in my Azure devops pipeline

How do i fix the npm error in my pipeline?
/opt/hostedtoolcache/node/16.13.2/x64/bin/npm ci
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 ERR! code 1
npm ERR! path /home/vsts/work/1/s/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /opt/hostedtoolcache/node/16.13.2/x64/bin/node /home/vsts/work/1/s/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/opt/hostedtoolcache/node/16.13.2/x64/bin/node',
npm ERR! gyp verb cli '/home/vsts/work/1/s/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.13.2 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb which failed Error: not found: python2
npm ERR! gyp verb which failed at getNotFoundError (/home/vsts/work/1/s/node_modules/which/which.js:13:12)
npm ERR! gyp verb which failed at F (/home/vsts/work/1/s/node_modules/which/which.js:68:19)
npm ERR! gyp verb which failed at E (/home/vsts/work/1/s/node_modules/which/which.js:80:29)
npm ERR! gyp verb which failed at /home/vsts/work/1/s/node_modules/which/which.js:89:16
npm ERR! gyp verb which failed at /home/vsts/work/1/s/node_modules/isexe/index.js:42:5
npm ERR! gyp verb which failed at /home/vsts/work/1/s/node_modules/isexe/mode.js:8:5
I am trying npm clean install but this is failing.

Mac m1 installing nodes_modules and sass not working

I'm trying to install npm on my project, 'npm install' doesnt work.
this is what my term return :
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
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 WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
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 request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
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 ERR! code 1
npm ERR! path /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/local/bin/node',
npm ERR! gyp verb cli '/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.14.2 | darwin | arm64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "c:python27python.exe" in the PATH
npm ERR! gyp verb whichfailed Error: not found: c:python27python.exe
npm ERR! gyp verbwhichfailed at getNotFoundError (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:13:12)
npm ERR! gyp verbwhichfailed at F (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:68:19)
npm ERR! gyp verbwhichfailed at E (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:80:29)
npm ERR! gyp verbwhichfailed at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:89:16
npm ERR! gyp verbwhichfailed at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/isexe/index.js:42:5
npm ERR! gyp verbwhichfailed at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/isexe/mode.js:8:5
npm ERR! gyp verbwhichfailed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verbwhichfailed c:python27python.exe Error: not found: c:python27python.exe
npm ERR! gyp verbwhichfailed at getNotFoundError (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:13:12)
npm ERR! gyp verbwhichfailed at F (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:68:19)
npm ERR! gyp verbwhichfailed at E (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:80:29)
npm ERR! gyp verbwhichfailed at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:89:16
npm ERR! gyp verbwhichfailed at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/isexe/index.js:42:5
npm ERR! gyp verbwhichfailed at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/isexe/mode.js:8:5
npm ERR! gyp verbwhichfailed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verbwhichfailed code: 'ENOENT'
npm ERR! gyp verbwhich` failed }
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "c:python27python.exe", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack at F (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack at E (/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/thibaultvigneron/Documents/Projets/portfolio/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.14.2
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! /Users/thibaultvigneron/.npm/_logs/2022-04-05T09_29_43_825Z-debug-0.log`
I have installed node v16.14 with nvm.
Try pyenv to manage your python environment.
Install pyenv
brew update
brew install pyenv
echo 'eval "$(pyenv init -)"' >> ~/.profile
Install python2
pyenv install 2.7.18
pyenv global system 2.7.18
Based on the line Error: Can't find Python executable "c:python27python.exe", you can set the PYTHON env variable., you should install Python for Windows Python.
Maybe your Python environment is not well set. Ensure the path to the Python binary is well configured.
check this out based on your error SS so far I have found this article
https://github.com/sass/embedded-host-node/issues/66
https://developpaper.com/mac-m1-arm-npm-install-error-handling/

While installing Web3js dependency it is showing node-gyp issue

I am trying to install a web3js dependency for my project. But there is an issue coming up with node-gyp.
Below is the error log for that"
> scrypt#6.0.3 preinstall D:\Learning\BlockChain Project\Inbox\node_modules\scrypt
> node node-scrypt-preinstall.js
> scrypt#6.0.3 install D:\Learning\BlockChain Project\Inbox\node_modules\scrypt
> node-gyp rebuild
D:\Learning\BlockChain Project\Inbox\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at TLSSocket.onConnectSecure (_tls_wrap.js:1049:34)
gyp ERR! stack at TLSSocket.emit (events.js:182:13)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:631:8)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Learning\BlockChain Project\Inbox\node_modules\scrypt
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN inbox#1.0.0 No description
npm WARN inbox#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 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\Shashank\AppData\Roaming\npm-cache\_logs\2019-01-19T18_07_03_360Z-debug.log
install windows-build-tools before installing web3 and its dependencies
npm install --global --production windows-build-tools
reference: https://github.com/nodejs/node-gyp
I had to install the above windows-build-tools but had to install with npm install --global --production windows-build-tools --vs2015 as the newer versions of this tool are going to not compile the web3 utils correctly with the node-gyp dependency. I wrangled this one for a while after uninstalling an old install of Visual Studio 2015 a couple of weeks ago.

Can not Install sharp

sharp#0.18.4 install C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
node-gyp rebuild
C:\Users\hp\AppData\Roaming\npm\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
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 Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\hp\AppData\Roaming\npm\node_modules\sharp
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN { Error: EPERM: operation not permitted, rmdir 'C:\Users\hp\AppData\Roaming\npm\node_modules'
npm WARN stack: 'Error: EPERM: operation not permitted, rmdir \'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\'',
npm WARN errno: -4048,
npm WARN code: 'EPERM',
npm WARN syscall: 'rmdir',
npm WARN path: 'C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp#0.18.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp#0.18.4 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\hp\AppData\Roaming\npm-cache\_logs\2017-12-27T19_25_54_261Z-debug.log
the easiest way to install sharp on windows OS is to use the following npm package
which is called windows-build-tools
npm install --global --production windows-build-tools
this as npm says it downloads
installs Visual C++ Build Tools, provided free of charge by Microsoft. These tools are required to compile popular native modules. It will also install Python 2.7, configuring your machine and npm appropriately.
after this npm install sharp

Trying to install truffle on Windows 10 by "$npm install - g truffle" Got a bunch of problems

$ npm install -g truffle
npm WARN deprecated to-iso-string#0.0.2: to-iso-string has been deprecated, use #segment/to-iso-string instead.
npm WARN deprecated jade#0.26.3: Jade has been renamed to pug, please install th e latest version of pug instead of jade
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
scrypt#6.0.3 preinstall C:\Users\Zachary Zhong\AppData\Roaming\npm\node_module s.staging\scrypt-b6fa2906
node node-scrypt-preinstall.js
C:\Users\Zachary Zhong\AppData\Roaming\npm\truffle -> C:\Users\Zachary Zhong\App Data\Roaming\npm\node_modules\truffle\cli.js
C:\Users\Zachary Zhong\AppData\Roaming\npm\truffle-exec -> C:\Users\Zachary Zhon g\AppData\Roaming\npm\node_modules\truffle\exec.js
scrypt#6.0.3 install C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\t ruffle\node_modules\scrypt
node-gyp rebuild
C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle\node_modules\scr ypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modul es\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Warning: Missing input files:
C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle\node_modules\scr ypt\build..\scrypt\win\include\config.h
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h
The system cannot find the file specified.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle \node_modules\scrypt\build\copied_files.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle \node_modules\scrypt\build\scrypt_wrapper.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe fail ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Zachary Zhong\AppData\Roaming\npm\node_modules\truffle\nod e_modules\scrypt
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
C:\Users\Zachary Zhong\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\truffle\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":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "truffle"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! scrypt#6.0.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script 'node-gyp rebuild'.
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 scrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls scrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Zachary Zhong\npm-debug.log
npm ERR! code 1
I've got 2 guides for installing on Windows:
Installing on Windows 10 using Ubuntu bash (preferred)
https://davidburela.wordpress.com/2017/05/12/how-to-install-truffle-testrpc-on-ubuntu-or-windows-10-with-windows-subsystem-for-linux/
Installing on Windows
https://davidburela.wordpress.com/2016/11/18/how-to-install-truffle-testrpc-on-windows-for-blockchain-development/
Given that you have not include any details about your dev environment, see this StackOverflow thread that discusses the same problem as yours: node gyp error TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified