npm ERR! Failed at the [email protected] postinstall script. npm ERR! This is probably not a problem

$ npm install

> [email protected] install F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_modul                                                                                                                                  es\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5                                                                                                                                  .2/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.2/win3                                                                                                                                  2-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 F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_m                                                                                                                                  odules\node-sass
> node scripts/build.js

Building: F:\softinstall\nodejs\node.exe F:\work\jnyy\server-no-dubbo\littlec-ee                                                                                                                                  cweb\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 [ 'F:\\softinstall\\nodejs\\node.exe',
gyp verb cli   'F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_modules\\n                                                                                                                                  ode-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 (F:\work\jnyy\server-no-dubbo\li                                                                                                                                  ttlec-eecweb\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:68:19)
gyp verb `which` failed     at E (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:80:29)
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\which\which.js:89:16
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\isexe\index.js:42:5
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\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 (F:\work\jnyy\server-no-dubbo\li                                                                                                                                  ttlec-eecweb\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:68:19)
gyp verb `which` failed     at E (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:80:29)
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\which\which.js:89:16
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\isexe\index.js:42:5
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\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 getNotFoundE                                                                                                                                  rror (F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_modules\\which\\whic                                                                                                                                  h.js:13:12)\n    at F (F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_mod                                                                                                                                  ules\\which\\which.js:68:19)\n    at E (F:\\work\\jnyy\\server-no-dubbo\\littlec                                                                                                                                  -eecweb\\node_modules\\which\\which.js:80:29)\n    at F:\\work\\jnyy\\server-no-                                                                                                                                  dubbo\\littlec-eecweb\\node_modules\\which\\which.js:89:16\n    at F:\\work\\jny                                                                                                                                  y\\server-no-dubbo\\littlec-eecweb\\node_modules\\isexe\\index.js:42:5\n    at F                                                                                                                                  :\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\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` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (F:\work\jnyy\server-no-dubbo\li                                                                                                                                  ttlec-eecweb\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:68:19)
gyp verb `which` failed     at E (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:80:29)
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\which\which.js:89:16
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\isexe\index.js:42:5
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (F:\work\jnyy\server-no-dubbo\li                                                                                                                                  ttlec-eecweb\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:68:19)
gyp verb `which` failed     at E (F:\work\jnyy\server-no-dubbo\littlec-eecweb\no                                                                                                                                  de_modules\which\which.js:80:29)
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\which\which.js:89:16
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_                                                                                                                                  modules\isexe\index.js:42:5
gyp verb `which` failed     at F:\work\jnyy\server-no-dubbo\littlec-eecweb\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: python\n    at getNotFoundEr                                                                                                                                  ror (F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_modules\\which\\which                                                                                                                                  .js:13:12)\n    at F (F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_modu                                                                                                                                  les\\which\\which.js:68:19)\n    at E (F:\\work\\jnyy\\server-no-dubbo\\littlec-                                                                                                                                  eecweb\\node_modules\\which\\which.js:80:29)\n    at F:\\work\\jnyy\\server-no-d                                                                                                                                  ubbo\\littlec-eecweb\\node_modules\\which\\which.js:89:16\n    at F:\\work\\jnyy                                                                                                                                  \\server-no-dubbo\\littlec-eecweb\\node_modules\\isexe\\index.js:42:5\n    at F:                                                                                                                                  \\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_modules\\isexe\\windows.js:3                                                                                                                                  6:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp verb check python version `C:\Python27\python.exe -c "import platform; print                                                                                                                                  (platform.python_version());"` returned: "2.7.12\r\n"
gyp verb get node dir no --target version specified, falling back to host node v                                                                                                                                  ersion: 8.11.3
gyp verb command install [ '8.11.3' ]
gyp verb install input version string "8.11.3"
gyp verb install installing version: 8.11.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: 8.11.3
gyp verb build dir attempting to create "build" dir: F:\work\jnyy\server-no-dubb                                                                                                                                  o\littlec-eecweb\node_modules\node-sass\build
gyp verb build dir "build" dir needed to be created? F:\work\jnyy\server-no-dubb                                                                                                                                  o\littlec-eecweb\node_modules\node-sass\build
gyp verb Not using VS2017: Could not use PowerShell to find VS2017
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: F:\work\jnyy\server-no-dubbo                                                                                                                                  \littlec-eecweb\node_modules\node-sass\build\config.gypi
gyp verb config.gypi checking for gypi file: F:\work\jnyy\server-no-dubbo\little                                                                                                                                  c-eecweb\node_modules\node-sass\config.gypi
gyp verb common.gypi checking for gypi file: F:\work\jnyy\server-no-dubbo\little                                                                                                                                  c-eecweb\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 [ 'F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_mod                                                                                                                                  ules\\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   'F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_mod                                                                                                                                  ules\\node-sass\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_mod                                                                                                                                  ules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\zlw\\.node-gyp\\8.11.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\\zlw\\.node-gyp\\8.11.3',
gyp info spawn args   '-Dnode_gyp_dir=F:\\work\\jnyy\\server-no-dubbo\\littlec-e                                                                                                                                  ecweb\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\zlw\\.node-gyp\\8.11.3\\<(targ                                                                                                                                  et_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=F:\\work\\jnyy\\server-no-dubbo\\little                                                                                                                                  c-eecweb\\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   'F:\\work\\jnyy\\server-no-dubbo\\littlec-eecweb\\node_mod                                                                                                                                  ules\\node-sass\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\zlw\.node-gyp\8.11.3
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build,                                                                                                                                   please add the "/m" switch.
Build started 2018/7/16 19:14:19.
Project "F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_modules\node-sass\buil                                                                                                                                  d\binding.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
MSBUILD : error MSB3428: δ▒ܼ▒▒▒ Visual C++ ▒▒▒▒▒VCBuild.exe▒▒▒▒Ҫ▒▒▒▒▒▒▒▒⣬1) ▒▒װ .                                                                                                                                  NET Framework 2.0 SDK▒▒2) ▒▒װ Microsoft Visual Studio 2005▒▒▒▒ 3) ▒▒▒▒▒▒▒▒▒▒▒▒װ▒                                                                                                                                  ▒▒▒▒▒▒▒λ▒ã▒▒뽫▒▒λ▒▒▒▒ӵ▒ϵͳ·▒▒▒С▒ [F:\work\jnyy\server-no-dubbo\littlec-eecweb\nod                                                                                                                                  e_modules\node-sass\build\binding.sln]
Done Building Project "F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_modules\                                                                                                                                  node-sass\build\binding.sln" (default targets) -- FAILED.

Build FAILED.

"F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_modules\node-sass\build\bindin                                                                                                                                  g.sln" (default target) (1) ->
(_src_\libsass target) ->
  MSBUILD : error MSB3428: δ▒ܼ▒▒▒ Visual C++ ▒▒▒▒▒VCBuild.exe▒▒▒▒Ҫ▒▒▒▒▒▒▒▒⣬1) ▒▒װ                                                                                                                                   .NET Framework 2.0 SDK▒▒2) ▒▒װ Microsoft Visual Studio 2005▒▒▒▒ 3) ▒▒▒▒▒▒▒▒▒▒▒▒                                                                                                                                  װ▒▒▒▒▒▒▒▒λ▒ã▒▒뽫▒▒λ▒▒▒▒ӵ▒ϵͳ·▒▒▒С▒ [F:\work\jnyy\server-no-dubbo\littlec-eecweb\n                                                                                                                                  ode_modules\node-sass\build\binding.sln]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.07
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 (F:\work\jnyy\server-no-dubbo\littlec-                                                                                                                                  eecweb\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_proces                                                                                                                                  s.js:198:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "F:\\softinstall\\nodejs\\node.exe" "F:\\work\\jnyy\\server-no-                                                                                                                                  dubbo\\littlec-eecweb\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--ve                                                                                                                                  rbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_libr                                                                                                                                  ary="
gyp ERR! cwd F:\work\jnyy\server-no-dubbo\littlec-eecweb\node_modules\node-sass
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EP                                                                                                                                  ERM: operation not permitted, lstat 'F:\work\jnyy\server-no-dubbo\littlec-eecweb                                                                                                                                  \node_modules\cryptiles\node_modules'
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 log                                                                                                                                  ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\zlw\AppData\Roaming\npm-cache\_logs\2018-07-16T11_14_20_68                                                                                                                                  6Z-debug.log

找了很久,开始以为是没有安装python环境问题(上面的代码是安装完python之后仍然存在的问题)

https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001374738150500472fd5785c194ebea336061163a8a974000

之后在github上找到了解决方案:

https://github.com/sass/node-sass/issues/2049

主要的问题是node-sass 不兼容node v8 的版本,需要将 node-sass 更新到 4.5.3版本,所以找到package.json文件,将"node-sass": "4.5.2"更改为"node-sass": "4.5.3",之后再npm install,然后npm run dev,就可以跑通了。

 

 

 

你可能感兴趣的:(npm)