laravel-elixir未安装在Windows 10中

时间:2019-03-14 03:56:46

标签: node.js laravel npm gulp laravel-elixir

更新:

请跟进我遇到的错误。如果它与任何人都完全匹配,但我认为您可以使用我遵循的方法来解决。请最后检查“解决方案”部分。

问题:

我正在尝试在Windows 10计算机上安装laravel-elixir。失败几次。尝试了很多解决方案,但都无济于事。拜托,我需要一个解决方案。

控制台中显示错误

npm install laravel-elixir --save-dev
npm WARN deprecated babel-preset-es2015@6.24.1:   Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
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 browserslist@0.4.0: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
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 hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.

> node-sass@3.13.1 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

> node-sass@3.13.1 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 node-gyp@3.8.0
gyp info using node@8.9.4 | 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 acorn-dynamic-import@4.0.0 requires a peer of acorn@^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! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 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

我的Package.Json文件包括

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

尝试了很多操作,例如删除节点模块文件夹和全新安装以及许多其他操作。目前我不知道该怎么办。

解决方案:

我对laravel和node.js技术非常陌生。但是我在网上搜索解决方案将近30个小时。我对一些知识有所了解。我希望如果我在任何部分上有误,请纠正我。这将是非常赞赏的。好的,现在要安装节点附加组件,您需要安装VC / VCExpress,而不仅仅是VC运行时/可再发行组件。就我而言,我需要安装python 2.7。所以首先,我运行了一个命令

  

npm install --global --production Windows-build-tools

然后需要通过此命令跟踪到节点的路径

  

npm配置设置python /path/to/python2.x.exe

现在安装laravel-elixir

  

npm安装laravel-elixir

瞧瞧!

希望有人会受益。

0 个答案:

没有答案