如何在尝试使用npm安装laravel-elixir时修复以下错误

问题描述 投票:-1回答:1

我正在使用laravel框架构建一个Web应用程序。我需要安装gulp。我使用npm安装了gulp并在输入命令gulp时,它提示我安装laravel-elixir。我尝试了npm install laravel-elixir,但它抛出了许多错误。

我正在使用laravel版本5.2,节点版本10.15.3,python 2.7。我安装了视觉c ++构建工具,如某处建议但没有任何工作。以下是我得到的错误。

C:\xampp\htdocs\udemy>npm install laravel-elixir
npm WARN deprecated [email protected]: ?  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/e
nv 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

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

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-64_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-64_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\udemy\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\xampp\htdocs\udemy\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --li
bsass_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\\udemy\\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.7" in the PATH
gyp verb `which` failed Error: not found: python2.7
gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\udemy\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\udemy\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\udemy\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\udemy\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\udemy\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\udemy\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb `which` failed  python2.7 { Error: not found: python2.7
gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\udemy\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\udemy\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\udemy\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\udemy\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\udemy\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\udemy\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2.7\n    at getNotFoundError (C:\\xampp\\htdocs\\udemy\\node_modules\\which\\which.js:13
:12)\n    at F (C:\\xampp\\htdocs\\udemy\\node_modules\\which\\which.js:68:19)\n    at E (C:\\xampp\\htdocs\\udemy\\node_modules\\which\\whi
ch.js:80:29)\n    at C:\\xampp\\htdocs\\udemy\\node_modules\\which\\which.js:89:16\n    at C:\\xampp\\htdocs\\udemy\\node_modules\\isexe\\in
dex.js:42:5\n    at C:\\xampp\\htdocs\\udemy\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:153:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python2.7". checking python launcher
gyp verb could not find "python2.7". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp verb check python version `C:\Python27\python.exe -c "import sys; print "2.7.14
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.15.3
gyp verb command install [ '10.15.3' ]
gyp verb install input version string "10.15.3"
gyp verb install installing version: 10.15.3
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: 10.15.3
gyp verb build dir attempting to create "build" dir: C:\xampp\htdocs\udemy\node_modules\laravel-elixir\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? C:\xampp\htdocs\udemy\node_modules\laravel-elixir\node_modules\node-sass\build
gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
gyp verb find vs2017   - Found Microsoft.VisualStudio.VC.MSBuild.Base
gyp verb find vs2017   - Missing a Windows SDK (Microsoft.VisualStudio.Component.Windows10SDK.* or Microsoft.VisualStudio.Component.Windows8
1SDK)
gyp verb find vs2017   - Some required components are missing, not using this installation
gyp verb Not using VS2017: No usable installation of VS2017 found
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\xampp\htdocs\udemy\node_modules\laravel-elixir\node_modules\node-sass\build\config.gy
pi
gyp verb config.gypi checking for gypi file: C:\xampp\htdocs\udemy\node_modules\laravel-elixir\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: C:\xampp\htdocs\udemy\node_modules\laravel-elixir\node_modules\node-sass\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\xampp\\htdocs\\udemy\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\xampp\\htdocs\\udemy\\node_modules\\laravel-elixir\\node_modules\\node-sass\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\xampp\\htdocs\\udemy\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Dell\\.node-gyp\\10.15.3\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Dell\\.node-gyp\\10.15.3',
gyp info spawn args   '-Dnode_gyp_dir=C:\\xampp\\htdocs\\udemy\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Dell\\.node-gyp\\10.15.3\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\xampp\\htdocs\\udemy\\node_modules\\laravel-elixir\\node_modules\\node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\xampp\\htdocs\\udemy\\node_modules\\laravel-elixir\\node_modules\\node-sass\\build',
gyp info spawn args   '-Goutput_dir=.' ]
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\Dell\.node-gyp\10.15.3
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' is not recognized as an internal or external command,
gyp ERR! stack operable program or batch file.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?
gyp ERR! stack     at C:\xampp\htdocs\udemy\node_modules\node-gyp\lib\build.js:142:25
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:301:5)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\udemy\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--ver
bose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\udemy\node_modules\laravel-elixir\node_modules\node-sass
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\xampp\htdoc
s\udemy\node_modules\fsevents\node_modules'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\xampp\htdocs\u
demy\node_modules\laravel-elixir\node_modules'
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\Dell\AppData\Roaming\npm-cache\_logs\2019-04-11T07_17_38_254Z-debug.log

有人可以建议我如何成功安装laravel-elixir以使gulp工作。 package.json file

php laravel npm gulp laravel-elixir
1个回答
0
投票

您收到“未找到HTTP错误404”,因为您正在尝试安装Github上不存在的node-sass(v3.13.1)版本。

请尝试以下方法:

  1. 删除你的node_modules文件夹和package-lock.json文件
  2. 运行npm install node-sass --save-dev
  3. 运行npm install gulp-sass --save-dev
  4. 运行npm install

如果它仍然无法正常工作,请尝试更新laravel-elixir。 在package.json中编辑它的行或从命令行更新。 目前最新版本是6.0.0-18,您使用的是^ 5.0.0。

© www.soinside.com 2019 - 2024. All rights reserved.