laravel-elixir is not installing in windows 10

643 views Asked by At

Update:

Please follow up the errors I was facing. If it matches with anyone exactly than I think you can resolve this using the methodes I followed. Please check the Solution part at the end.

Problem:

I am trying to install laravel-elixir on windows 10 machine. Failed several times. Tried a lot's of solutions but none helped. Please, I need a solution.

Error showing in the console

npm install laravel-elixir --save-dev
npm WARN deprecated [email protected]:   Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.

> [email protected] install C:\xampp\htdocs\laravel_project\laravel_project\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> [email protected] postinstall C:\xampp\htdocs\laravel_project\laravel_project\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\xampp\htdocs\laravel_project\laravel_project\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 [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\xampp\\htdocs\\laravel_project\\laravel_project\\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 [email protected]
gyp info using [email protected] | win32 | 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` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\laravel_project\laravel_project\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\laravel_project\laravel_project\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\laravel_project\laravel_project\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\laravel_project\laravel_project\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\laravel_project\laravel_project\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_modules\\which\\which.js:13:12)\n
at F (C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_modules\\which\\which.js:68:19)\n    at E (C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_modules\\which\\
which.js:80:29)\n    at C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_modules\\which\\which.js:89:16\n    at C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_mo
dules\\isexe\\index.js:42:5\n    at C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\python\Python36\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\python\Python36\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack     at emitOne (events.js:116:13)
gyp ERR! stack     at Socket.emit (events.js:211:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:554:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\laravel_project\\laravel_project\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsa
ss_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\laravel_project\laravel_project\node_modules\node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN [email protected] requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\farabi\AppData\Roaming\npm-cache\_logs\2019-03-14T03_49_51_158Z-debug.log

My Package.Json file includes

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-notify": "^2.2.0"
  },
  "dependencies": {
    "bootstrap-sass": "^3.0.0",
    "laravel-elixir": "^5.0.0"
  }
}

Tried a lot of things like deleting the node-module folder and fresh install & many other things. At this moment I don't know what to do.

Solution:

I am very new to laravel & node.js technology. But I was searching for solutions over the web for almost 30 hours. I gained somewhat about some knowledge. I wish if I'm wrong about any part, please correct me. It will be very much appreciatable. Okay, now the thing is to install node add-ons, you need to have VC/VCExpress installed and not just the VC runtime/redistributable. And in my case I need python 2.7 installed. So at first, I ran a command

npm install --global --production windows-build-tools

Then need to follow up the path to node by this command

npm config set python /path/to/python2.x.exe

And now install laravel-elixir

npm install laravel-elixir

and voilĂ !!!

hope someone will be beneficial.

0

There are 0 answers